There is a subtle difference between the following two:
abstract member Do : int * string -> unit abstract member Do : (int * string) -> unit
If you add parentheses, you say that this parameter is a tuple, and the compiler should create a method that accepts Tuple<int, string> . Without parentheses, the method will be compiled as taking two parameters. In most cases, this is hidden, and you can ignore it, but, unfortunately, not always.
So, you can either change the interface definition to use the usual βtwo-parameterβ method (this would be my preferred method - you can still call the method with a tuple as an argument and look better in the .NET / C # view):
type IInterface = abstract member Do : int * string -> unit abstract member Do : int -> unit type ImplementingClass = interface IInterface with member this.Do (i, s) = () member this.Do i = ()
Or you can implement the interface as is:
type ImplementingClass = interface IInterface with member this.Do((i:int, s:string)) = () member this.Do(i:int) = ()
Unfortunately, this is a little ugly - you need type annotations so that the compiler can uniquely decide which method you are implementing.
source share