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
innocuous.scala:3:error: variable definition needs typebecause'y' is used asa named argument in its body.
Error occurred in an application involving default arguments.
lazyvaly= foo(x =20)
^
one error found
None of the following fail in the same way:
valy= foo(x =20)
OR
lazyvaly= foo(20)
It appears that combining the lazy modifier on y with a named arg in the application of foo causes it to blow up.
The text was updated successfully, but these errors were encountered:
@hubertp said:
This one is most probably a correct error. There was recently a similar bug report with var instead of lazy val and the problem is that both create getters and setters and the disambiguation mechanism that drives the names defaults expansion is ambiguous in this is situation.
I will see if we can improve on the error message but this is again non trivial due to some of the internal stuff in the compiler (type completers).
The following code causes a compilation error:
The error is as follows:
None of the following fail in the same way:
OR
It appears that combining the
lazy
modifier ony
with a named arg in the application offoo
causes it to blow up.The text was updated successfully, but these errors were encountered: