I'm trying to get a grip on F#, and in the process I am converting some C# code. I'm having some trouble with defining properties in an interface and implementing them in a type.
Consider the following code:
module File1
type IMyInterface =
abstract member MyProp : bool with get, set
abstract member MyMethod : unit -> unit
type MyType() =
interface IMyInterface with
member val MyProp = true with get, set
member self.MyMethod() = if MyProp then () else ()
The documentation for F# properties appears to state that my implementation of MyProp in MyType is correct, however, the compiler complains that "The value or constructor 'MyProp' is not defined". Any ideas?