在F#中,假设有以下类:
为什么以下代码可以编译通过:
以下代码无法编译:
type Foo() =
member this.Bar<'t> (arg0:string) = ignore()
为什么以下代码可以编译通过:
let f = new Foo()
f.Bar<Int32> "string"
以下代码无法编译:
let f = new Foo()
"string" |> f.Bar<Int32> //The compiler returns the error: "Unexpected type application"