This is the working example from here:
type MethodExample() =
// standalone method
member this.AddOne x =
x + 1
// calls another method
member this.AddTwo x =
this.AddOne x |> this.AddOne
That is what I want to do:
type IMethod =
abstract member AddOne: a:int -> int
abstract member AddTwo: a:int -> int
type MethodExample() =
interface IMethod with
member this.AddOne x =
x + 1
// calls another method
member this.AddTwo x =
this.AddOne x |> this.AddOne
The AddOne function is not available, I also tried to downcast this to MethodExample but is horrible and does not work.
How can I do it?
AddOnetoMethodExample, rename to_AddOnethen I can call it inside the interface implementation. This may be ugly but it works. - Nghia Bui