How do I write this member constraint in F#?
问题 For a type type Cow() = class member this.Walk () = Console.WriteLine("The cow walks.") end I can write a method which enforces a member constrain for method Walk like let inline walk_the_creature creature = (^a : (member Walk : unit -> unit) creature) // and then do walk_the_creature (Cow()) In this case the type is inferred. I am unable to explicitly write a constraint on the creature parameter like this // Does not compile // Lookup on object of indeterminate type based on information