-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Wrong linearization for super calls caused by unrelated trait mixins #20284
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
Labels
Milestone
Comments
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
May 13, 2024
scala#20284 started breaking since we now balance AndTypes to avoid performance drops. But (re-)balancing an AndType interferes with the logic that determines which symbol is referred by a super select. This is fixed by two changes: - Form types of super with `AndType` instead of `&` - Don't simplify types of super since that would rebalance the underlying AndTypes. Fixes scala#20284
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
May 13, 2024
scala#20284 started breaking since we now balance AndTypes to avoid performance drops. But (re-)balancing an AndType interferes with the logic that determines which symbol is referred by a super select. This is fixed by two changes: - Form types of super with `AndType` instead of `&` - Don't simplify types of super since that would rebalance the underlying AndTypes. Fixes scala#20284
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
May 19, 2024
scala#20284 started breaking since we now balance AndTypes to avoid performance drops. But (re-)balancing an AndType interferes with the logic that determines which symbol is referred by a super select. This is fixed by two changes: - Form types of super with `AndType` instead of `&` - Don't simplify types of super since that would rebalance the underlying AndTypes. Fixes scala#20284
odersky
added a commit
that referenced
this issue
May 26, 2024
#20284 started breaking since we now balance AndTypes to avoid performance drops. But (re-)balancing an AndType interferes with the logic that determines which symbol is referred by a super select. This is fixed by two changes: - Form types of super with `AndType` instead of `&` - Don't simplify types of super since that would rebalance the underlying AndTypes. Fixes #20284
WojciechMazur
pushed a commit
that referenced
this issue
Jul 8, 2024
#20284 started breaking since we now balance AndTypes to avoid performance drops. But (re-)balancing an AndType interferes with the logic that determines which symbol is referred by a super select. This is fixed by two changes: - Form types of super with `AndType` instead of `&` - Don't simplify types of super since that would rebalance the underlying AndTypes. Fixes #20284 [Cherry-picked f0560b2]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Sorry for slightly long minimization, didn't manage to make it any shorter.
Behavior changed in 3.3.3, used to work fine in 2.13.13 and 3.3.1 at least.
Test1
is the reproduction -D.print
andB.print
are not getting calledTest2
has nowith Z
, which shouldn't matter, and yet it "fixes" the problemTest3
extends theX
,Y
andZ
traits first instead of last likeTest1
, which also causes allprint
s to runCompiler version
3.3.1, 3.4.1
Minimized code
scala-cli run test.sc -S 3.3.3
test.sc
:Output
In scala 3.3.3 and 3.4.1:
In scala 2.13.13 and 3.3.1:
Expectation
Which super method calls are executed is not affected by "extra" traits
The text was updated successfully, but these errors were encountered: