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 deterministically adding additional interfaces #20593

Merged

Conversation

raboof
Copy link
Contributor

@raboof raboof commented Jun 18, 2024

When a class contains calls to 'super' for traits it does not directly implement, these are added to the list of interfaces of the generated class. Previously, because these interfaces were determined using set logic, the ordering of that list was not deterministic.

This PR makes the order deterministic assuming the order in which these calls are registered using registerSuperCall in the CollectSuperCalls phase is deterministic within each class. This seems likely to me but it'd be great if someone could confirm.

Fixes #20496

@raboof raboof force-pushed the fix-deterministic-additional-interfaces branch 3 times, most recently from 03ff49d to 668860c Compare June 19, 2024 09:02
@raboof raboof marked this pull request as ready for review June 19, 2024 09:03
When a class contains calls to 'super' for traits it does
not directly implement, these are added to the list of interfaces
of the generated class. Previously, because these interfaces were
determined using set logic, the ordering of that list was not
deterministic.

This change makes the order deterministic (assuming the order in
which these calls are registered using `registerSuperCall` in the
`CollectSuperCalls` phase is deterministic within each class)

Fixes scala#20496
@raboof raboof force-pushed the fix-deterministic-additional-interfaces branch from 668860c to 7500b05 Compare June 19, 2024 09:18
@raboof raboof requested a review from dwijnand June 28, 2024 09:35
@dwijnand dwijnand merged commit 700db3c into scala:main Jul 1, 2024
24 checks passed
@Kordyjan Kordyjan added this to the 3.5.1 milestone Jul 3, 2024
WojciechMazur added a commit that referenced this pull request Jul 10, 2024
…21151)

Backports #20593 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
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.

'implements' list order not deterministic
3 participants