F# compilation error: Unexpected type application

Posted by Jim Burger on Stack Overflow See other posts from Stack Overflow or by Jim Burger
Published on 2010-04-30T07:53:23Z Indexed on 2010/04/30 7:57 UTC
Read the original article Hit count: 198

Filed under:
|
|

In F#, given the following class:

type Foo() =
    member this.Bar<'t> (arg0:string) = ignore()

Why does the following compile:

let f = new Foo()
f.Bar<Int32> "string"

While the following won't compile:

let f = new Foo()
"string" |> f.Bar<Int32> //The compiler returns the error: "Unexpected type application"

© Stack Overflow or respective owner

Related posts about F#

Related posts about generics