Press CTRL+C or CMD+C to copy the selected text and close this dialog.
Tweet
110 people like it. Like the snippet!
Invoke the methods from incompatible types
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
type Cat() = member this.Walk() = printfn "cat walk" type Dog() = member this.Walk() = printfn "dog walk" let adapter() = let cat = Cat() let dog = Dog() let inline walk (x : ^T) = (^T : (member Walk : unit->unit) (x)) walk(cat) walk(dog)