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
testmethod is defined as a method that takes a tuple of twounitvalues as arguments. If you use Reflection to get the MethodInfo, the method is defined as:That matches the
OKmethod, but not theKOmethod.If you redefine the interface to
Then
OKdoesn't compile, butKOdoes.This alternative version produces a
testmethod which takes two arguments: