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
java.lang.StackOverflowError
at Main$$$$anon$$1$$Test2.lazy2((virtual file):8)
at Main$$$$anon$$1$$Test2.lazy1((virtual file):7)
at Main$$$$anon$$1$$Test2.lazy2((virtual file):8)
at Main$$$$anon$$1$$Test2.lazy1((virtual file):7)
...
The text was updated successfully, but these errors were encountered:
Eduard Shustrov (neonice) said:
The bug has been tested sucessfully against (the bug presents in) versions 2.7.7.final and 2.8.0.r21325-b20100404020122.
@dragos said:
I wouldn't call this a bug. There is no guarantee in the spec that scalac catches such cases, and static checking of initialization is still being researched. In the presence of overriding, this becomes much more difficult:
These classes may be compiled separately, so I don't see any way to guarantee correct errors. I agree that a warning is desirable, but it would work only in cases so obvious that it's not worth the effort.
Cross-references in lazy vals initialization is not detected by compiler as a compilation error and leads to stack overflow while executing the code.
Here is a small script example:
And here is the script execution output:
The text was updated successfully, but these errors were encountered: