F#: Must fully qualify class members, even inside the class

It is not the end of the world, but somewhat annoying: class members must always be referred by their fully qualified name, even inside class methods:

type Foo =
  static member Method(x) = ...
  static member Field = ...
  member self.FooBar() =
    Method(42) // won't work: "constructor Method is not defined"
    Foo.Method( Field ) // won't work either
Posted in

Leave a Reply

Your email address will not be published. Required fields are marked *