-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
An object
in sealed trait
inside of a function crashes the compiler
#17135
Comments
object
in sealed trait
insite of a function crashes the compilerobject
in sealed trait
inside of a function crashes the compiler
note the lack of an enriched crash report, despite #17031 |
also it's not finessed. |
Scala 3 meeting notes:
|
I have a compiler error for a generic trait when moving its definition to a nested function body:
The compiler log with an error
Is it the same issue or should be tracked separately? |
@plokhotnyuk I think we can reasonably assume it's the same |
More simplifications:
So, it seems to be a bad feature interaction between 3 phases
|
scala#17135 shows that traits also need an outer accessor if they are in a toplevel method (or lazy val). Fixes scala#17135
In fact, the fault was exclusively ExplicitOuter's. |
Compiler version
3.3.1-RC1-bin-20230318-7226ba6-NIGHTLY
Minimized code
Output (click arrow to expand)
Workaround
Replace
sealed trait
with Scala 3enum
.The text was updated successfully, but these errors were encountered: