You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using default parameters on the init method results in compilation errors. For example,
local class A
-- does not compile
def init(i : int = 0) : unit
println(i)
end
-- compiles and works
def other(i : int = 0) : unit
println(i)
end
end
results in error:
"Init.enc" (line 3, column 3)
Constructor method 'init' can only be called during object creation
In expression:
this.init(0)
In expression:
return(this.init(0))
In method '_init1' of type 'unit'
In class 'A'
This is undoubtedly due to the way methods using default parameters are compiled, which is incompatible with the restrictions on init.
The text was updated successfully, but these errors were encountered:
Using default parameters on the
init
method results in compilation errors. For example,results in error:
This is undoubtedly due to the way methods using default parameters are compiled, which is incompatible with the restrictions on
init
.The text was updated successfully, but these errors were encountered: