Open cpitclaudel opened 2 years ago
Other failing test that uses this
:
datatype T = Last(x: bool) | NotLast(next: T) {
function method FindLast(): bool {
if this.Last? then (() => x)()
else this.next.FindLast()
}
}
The solution would be to copy the value of _this to a local final variable, e.g. https://stackoverflow.com/a/27593059/1287856
The following code compiles to invalid Java code:
The faulty Java code:
While waiting for a fix, affected users can add
{:tailrecursion false}
infunction method {:tailrecursion false} TailRecursive