Created
September 24, 2012 07:36
-
-
Save bleis-tift/3774779 to your computer and use it in GitHub Desktop.
型拡張でオーバーロードすると式木が取れない
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fsiで | |
type Hoge() = | |
member this.Piyo(i: int) = "piyo1" | |
member this.Piyo(s: string) = "piyo2" | |
let f () = | |
<@ (fun (h: Hoge) -> h.Piyo(42)) @>;; // <- ここと、 | |
type Hoge with | |
member this.Foo(i: int) = "foo1" | |
member this.Foo(s: string) = "foo2" | |
let g () = | |
<@ (fun (h: Hoge) -> h.Foo(42)) @>;; // <- ここのダブルセミコロンを取ると動く | |
f () // OK | |
g () // NG | |
;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment