Skip to content
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

Fix pattern generation in "ordinal" mirror method #17570

Merged
merged 1 commit into from
May 24, 2023

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 24, 2023

The "ordinal" method generated non-sensical patterns if the cases of a sealed trait were found in the trait itself. In that case the ordinal method would be placed in the companion object, but still tried to access the cases via the this of the companion class.

We are now more careful and fall back to type projections in comparisons.

Fixes #17556

The "ordinal" method generated non-sensical patterns if the cases
of a sealed trait were found in the trait itself. In that case the
ordinal method would be placed in the companion object, but still tried
to access the cases via the `this` of the companion class.

We are  now more careful and fall back to type projections in
comparisons.

Fixes scala#17556
@bishabosha bishabosha merged commit aa74ac4 into scala:main May 24, 2023
@bishabosha bishabosha deleted the fix-17556 branch May 24, 2023 12:25
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 1, 2023
Kordyjan added a commit that referenced this pull request Nov 17, 2023
…18940)

Backports #17570 to the LTS branch.

PR submitted by the release tooling.
@Kordyjan Kordyjan modified the milestones: 3.4.0, 3.3.2 Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compile shows weird message: assertion failed: asTerm called on not-a-Term val <none>
3 participants