Skip to content

Make tests for capability parents of Array class more robust#25695

Merged
odersky merged 3 commits intoscala:mainfrom
dotty-staging:fix-25644
Apr 2, 2026
Merged

Make tests for capability parents of Array class more robust#25695
odersky merged 3 commits intoscala:mainfrom
dotty-staging:fix-25644

Conversation

@odersky
Copy link
Copy Markdown
Contributor

@odersky odersky commented Apr 2, 2026

It was quite leaky before, which was hidden by the fact that we added these
parents manually to the array class in transformSym. But this works only if
separation checking is specified by a setting, since transformSym does not have
access to the current compilation unit. So we need to drop the special
logic in transformSym and rely on the fixed derivedFromCapTrait tests
instead.

Fixes #25644

odersky added 2 commits April 1, 2026 23:14
It was quite leaky before, which was hidden by the fact that we added these
parents manually to the array class in transformSym. But this works only if
separation checking is specified by a setting, since transformSym does not have
access to the current compilation unit. So we need to drop the special
logic in transformSym and rely on the fixed derivedFromCapTrait tests
instead.

Fixes scala#25644
It only worked reliably if separation checking was turned by a setting. Language
imports were not guaranteed to work. So it's better to turn off this logic and rely
on the other changes that all do take care of arrays in both modes.
@odersky odersky requested a review from bracevac April 2, 2026 15:46
Copy link
Copy Markdown
Contributor

@bracevac bracevac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

@odersky odersky merged commit c39a78e into scala:main Apr 2, 2026
64 checks passed
@odersky odersky deleted the fix-25644 branch April 2, 2026 20:21
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.

Separation checking import vs. compiler option are inconsistent

3 participants