I have an interface which takes a generic parameter and has an abstract method
type MyInterface<'a> =
abstract member abstractMethod: 'a -> 'a
...and I have a derived class which inherits from base class using unit for the type parameter
type Derived() =
interface MyInterface<unit> with
override this.abstractMethod (_) = ()
but the compiler complains that
Error The member 'abstractMethod : unit -> unit' does not have the correct type to override the corresponding abstract method.
If I use another type instead of unit, int for example, the code compiles.
Is this a bug in the compiler? Is there a workaround for it?
Thanks!