-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Regression: class with no object shadows outer object #11853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The error message calls them creator proxy when they're now called constructor proxy so it's a bit confusing but this is a feature, not a bug: http://dotty.epfl.ch/docs/reference/other-new-features/creator-applications.html, every class gets a synthetic companion with a synthetic apply method, so the shadowing is unavoidable. |
The bug may be where the spec turns to their date in the darkened theater and whispers with menacing assurance:
|
@smarter Damn I thought the new auto- What do you think about saying "companion object" in the error message instead? From a user's pov I understand that a |
I also expected the new |
But "constructor proxy companions cannot be used as values by themselves". The documentation also says:
It's nice that Scala 3 thinks of the poor StackOverflow answerers who came in after all the high-reputation answers were already taken. Some nice generalizations with just enough differences to thoroughly confuse people should do the trick. |
Compiler version
3.0.0-RC1
Minimized code
Output
Expectation
It should compiles as it does in Scala 2.x.
The text was updated successfully, but these errors were encountered: