I basically ask why the following lines of code do not compile:
type IGenericType<'a> =
abstract member MyFunc : 'a -> 'a -> 'a
type Implementer() =
member x.Test () () = () // unit->unit->unit
interface IGenericType<unit> with
member x.MyFunc a b = b // FS0017
// member x.MyFunc () () = () // FS0017
Just wondering if there is a way to do this work as intended. I assume this is a limitation associated with the implementation of units and generics.
Im using the following workaround at the moment:
type Nothing =
| Nothing
type Implementer() =
interface IGenericType<Nothing> with
member x.MyFunc a b = b
Hope someone can highlight this behavior a bit.
source
share