-
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
Simple snippet crashing when Ycheck:all #18901
Comments
Edit: It changes in mixin phase, it drops the |
If I understand it correctly, prefixIsElidable assumes that the |
Fix #18901 The check in `prefixIsElidable` was defined as follows: ```scala tp.symbol.isParamOrAccessor && !pre.cls.is(Trait) && ctx.owner.enclosingClass == pre.cls ``` I assume that `!pre.cls.is(Trait)` condition was introduced to accommodate for `Mixin` phase getting rid of `ParamAccessor` defined in traits. However, the prefix does not indicate where the symbol is really defined - it only represents the prefix from the perspective of the current template, so it could be inherited. When it's inherited from a trait, the prefix would be the current class, but the member still is defined in the trait, and `Mixin` would get rid of the `ParamAccessor` flag. Therefore, I changed this condition to the following: ```scala tp.symbol.isParamOrAccesso && !pre.cls.is(Trait) && !tp.symbol.owner.is(Trait) && ctx.owner.enclosingClass == pre.cls ```
Compiler version
3.4.0-RC1-bin-20231109-c7b3d7b-NIGHTLY
Minimized code
This code comes from
tests/init/neg/trait1
. More snippets like this are crashing. After implementing #18634 the pipeline goes on instead of failing on the first warn, and the compiler crashes.Output (click arrow to expand)
The text was updated successfully, but these errors were encountered: