It is impossible to determine (?) Operator overloading by type:
type Foo =
val s : string
new(s) = { s = s }
static member (?) (foo : Foo, name : string) = foo.s + name
let foo = Foo("hello, ")
let hw = foo? world
Everything works fine if I use stand-alone let-binding to define a statement:
let (?) (foo : Foo) (name : string) = foo.s + name
let hw = foo? world
But I need to specify the operator op_Dynamicdirectly for the type Foo. What happened to the first piece of code?
Using F# 1.9.7.4@Visual Studio 2010 Beta2
source
share