Is there any real reason why KO would not work ?
type IBase =
abstract member test : (unit * unit) -> unit
type OK() =
interface IBase with
member x.test ((titi,tata)) = () //OK
type KO() =
interface IBase with
member x.test (titi,tata) = () //fail : This override takes a different number of arguments to the corresponding abstract member
Because the parentheses mean something in F# (it indicates a tuple), so they're not the same.
As given, the
test
method is defined as a method that takes a tuple of twounit
values as arguments. If you use Reflection to get the MethodInfo, the method is defined as:That matches the
OK
method, but not theKO
method.If you redefine the interface to
Then
OK
doesn't compile, butKO
does.This alternative version produces a
test
method which takes two arguments: