The following works...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 

#light

type 'a Foo(pos:int*int) = 
  let mutable pos = pos
  member s.Position
    with get() = pos
    and set(v) = pos <- v

type 'a Bar (src : Foo<'a>, dest : Foo<'a>) = //no need to use mutual recursion
  let src = src
  let dest = dest
  member s.Src = src
  member s.Test = src.Position
  member s.OtherTest = s.Src.Position
By on 5/18/2008 3:15 AM ()
1
2
 
type 'a Bar1 (src : Foo<'a>, dest : Foo<'a>) =...

is NOT equivalent to

1
type 'a Bar when 'a :> 'a Foo  (src, dest)

Bar1 has no constraints on its type parameter (although in this simple case 'a :> 'a Foo by construction).
Overall, I think this is a compiler bug that should be reported to fsbugs

By on 5/18/2008 5:34 AM ()

Hi all,

Yep, we've got the issue logged in our database now - thanks for reporting it!

Kind regards

Don

By on 5/20/2008 3:38 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper