Skip to content

Re-fix #26959 by avoiding Unit =:= on class refs to fix cyclic TASTy load - #27045

Merged
SolalPirelli merged 2 commits into
scala:mainfrom
Gedochao:maintenance/tests-26959
Sep 11, 2026
Merged

SolalPirelli merged 2 commits into
scala:mainfrom
Gedochao:maintenance/tests-26959

Conversation

@Gedochao

@Gedochao Gedochao commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #26959

This merely ports tests from #27010 / scala#1112 to the main branch, to prevent #26959 from haunting us again (as we fixed it by accident, mostly ๐Ÿ™ƒ)

As per #26959 (comment), it seems we need to re-fix this for Scala 3.10.
This is almost the same as scala#1112, just without the optimizer adjustments.

Have you relied on LLM-based tools in this contribution?

No

How was the solution tested?

New automated tests (including the issue's reproducer, if applicable)

@Gedochao Gedochao changed the title Port anti-regression tests for #26959 Re-fix #26959 by avoiding Unit =:= on class refs to fix cyclic TASTy load Sep 10, 2026
private def nonClassEqUnit(tp: Type)(using Context): Boolean = tp.stripTypeVar match
case tref: TypeRef if tref.symbol.isClass => false
case AnnotatedType(tp1, _) => nonClassEqUnit(tp1)
case _ => tp =:= defn.UnitType

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is another possible working solution frozen_=:=? (and without this potentially flaky destructuring)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Tried it, but it seems it makes the tests fail again... but I may be missing something.
Feel free to open an alternative approach.

@Gedochao
Gedochao marked this pull request as ready for review September 10, 2026 14:49
@Gedochao Gedochao added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Sep 10, 2026
@Gedochao Gedochao added this to the 3.10.0 milestone Sep 10, 2026
@SolalPirelli
SolalPirelli merged commit a054e71 into scala:main Sep 11, 2026
63 checks passed
@Gedochao
Gedochao deleted the maintenance/tests-26959 branch September 11, 2026 07:38
@WojciechMazur WojciechMazur added backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" and removed backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. labels Sep 23, 2026
WojciechMazur added a commit that referenced this pull request Sep 24, 2026
โ€ฆlic TASTy load" to 3.10.0 (#27150)

Backports #27045 to the 3.10.0-RC3.

PR submitted by the release tooling.
[skip ci]
@WojciechMazur WojciechMazur added backport:done This PR was successfully backported. and removed backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" labels Sep 24, 2026
alexarchambault pushed a commit to plasmon-scala/scala3 that referenced this pull request Nov 4, 2026
โ€ฆASTy load (scala#27045)

Fixes scala#26959

~This merely ports tests from scala#27010
/ scala#1112 to the `main` branch, to
prevent scala#26959 from haunting us
again (as we fixed it by accident, mostly ๐Ÿ™ƒ)~

As per
scala#26959 (comment), it
seems we need to re-fix this for Scala 3.10.
This is almost the same as
scala#1112, just without the
optimizer adjustments.

## Have you relied on LLM-based tools in this contribution?
No

## How was the solution tested?
New automated tests (including the issue's reproducer, if applicable)
[Cherry-picked a054e71]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:done This PR was successfully backported.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3.9.0 regression: new Cyclic reference error in the code that worked before

4 participants