Putting both in one file works for me:

1
2
3
4
5
6
7
type A() =
    let mutable b: B option = None

and B() =


    let a: A = A()

Note that the "and" replaces the "type" and any attributes, e.g. "[<AbstractClass>]", come after the "and".

By on 8/14/2008 4:03 AM ()

Thanks, that worked (I didn't realise that 'and' replaced the second 'type').

Is there no way I can put the two types in different files? They are rather large, and I think there will be more dependent types associated with them in future. It would be a shame to have to put most of the program in a single file.

By on 8/14/2008 6:19 AM ()

As far as I know you can't put mutually dependent types in different files. You also can't split modules over multiple files. You can split namespaces over multiple files, though only types can be put directly into namespaces.

By on 8/14/2008 9:21 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