SHOW:
|
|
- or go back to the newest paste.
1 | - | // this works perfectly |
1 | + | // this works as expected |
2 | type Example() = | |
3 | - | member this.F(i) = printfn "%d" i |
3 | + | member __.F(i) = printfn "%d" i |
4 | ||
5 | let inline f (x : ^a) = | |
6 | (^a : (member F : int -> unit) (x, 1)) | |
7 | (^a : (member F : int -> unit) (x, 2)) | |
8 | ||
9 | f (Example()) | |
10 | - | // this doesn't but should (function signatures are identical) |
10 | + | |
11 | // this doesn't work | |
12 | - | x.F(1) |
12 | + | |
13 | // the compiler knows that there must be member F and its signature | |
14 | // so the following should be possible | |
15 | x.F(1) | |
16 | x.F(2) |