Skip to content

Conversation

@mbovel
Copy link
Member

@mbovel mbovel commented Nov 27, 2025

Hot fixes #24550. This is a mitigation, but doesn't fix the root cause.

@mbovel mbovel changed the title Skip capture checking annotations in TypeMap when capture checking is not enabled Skip CC annotations in TypeMap when CC is not enabled Nov 27, 2025
@mbovel
Copy link
Member Author

mbovel commented Nov 27, 2025

Minimized failing test:

@main def Test: Unit =
  println(IArray.equals(IArray("a"), IArray("b")))

Error:

-- [E007] Type Mismatch Error: tests/run/IArrayOps.scala:2:24 ------------------
2 |  println(IArray.equals(IArray("a"), IArray("b")))
  |                        ^^^^^^^^^^^
  |                        Found:    IArray[String]
  |                        Required: Array[? <: Object]
  |
  | longer explanation available when compiling with `-explain`

IArray.equal has signature:

def equals(xs: IArray[AnyRef^], ys: IArray[AnyRef^]): Boolean

Could the problem be that IArray is dealiased to Array? It is the case in MethodType.paramInfos already.

@mbovel
Copy link
Member Author

mbovel commented Nov 27, 2025

Found the culprit: suppressIntoIfParam keeps annotations but strips opaque types aliases… So if we strip some annotations, then we suddenly leak some opaque type definitions, already from the unpickler.

Fixing by using dealiasKeepAnnotsAndOpaques instead of dealiasKeepAnnots in FollowAliasesMap.

@mbovel mbovel marked this pull request as ready for review November 27, 2025 16:18
@mbovel mbovel changed the title Skip CC annotations in TypeMap when CC is not enabled Strip CC annotations in TypeMap when CC is not enabled Nov 27, 2025
@mbovel mbovel force-pushed the mb/skip-annotation-map branch from a165c0c to fe1dfee Compare November 27, 2025 16:31
@mbovel mbovel requested a review from odersky November 27, 2025 19:00
@odersky odersky merged commit fe49539 into scala:main Nov 27, 2025
45 checks passed
@odersky odersky deleted the mb/skip-annotation-map branch November 27, 2025 19:35
@WojciechMazur WojciechMazur added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Nov 28, 2025
@WojciechMazur WojciechMazur added this to the 3.8.0 milestone Nov 28, 2025
mbovel added a commit that referenced this pull request Nov 29, 2025
This reverts one commit in #24556 but keeps its logic. It just moves the
code elsewhere.

---------

Co-authored-by: Matt Bovel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Severe compile performance regression for Seq.++ chain

3 participants