I understand that when you define a recursive member function inside a type, then there is no need to define a function as recursive. The meaning of using a keyword rec.
however, when I do this:
type hello() = class
member this.recursion(x) =
match x with
|10 -> printfn "%A" x
|_ -> printfn "%A" x
recursion(x+1)
end
Then I get the error that recursion is not defined.
I tried this.recursion, but then still get a warning:
A recursive reference to the 'this' object is not used. Having a recursive object reference adds runtime initialization checks to members of this and derived types. Try removing this recursive object reference.
So, I am wondering what is the right way to define a recursive member function in a type?