在F#中,给出以下类:
type Foo() =
member this.Bar<'t> (arg0:string) = ignore()
Run Code Online (Sandbox Code Playgroud)
为什么以下编译:
let f = new Foo()
f.Bar<Int32> "string"
Run Code Online (Sandbox Code Playgroud)
虽然以下内容不会编译:
let f = new Foo()
"string" |> f.Bar<Int32> //The compiler returns the error: "Unexpected type application"
Run Code Online (Sandbox Code Playgroud)