Skip to content

Conversation

@mbovel
Copy link
Member

@mbovel mbovel commented Nov 24, 2025

Fixes #23752.

typed(tree.tpt, AnyTypeConstructorProto)

val tparams = tpt1.tpe.typeParams
val tparams = tpt1.tpe.dealiasKeepAnnotsAndOpaques.typeParams
Copy link
Member

Choose a reason for hiding this comment

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

I've been playing with some examples. In all of them, typeParams was able to return the actual typeParams but the top level case (the issue this tries to solve) without the dealiasing. Which means that in the contract of typeParams, it should be able to return the actual params without dealiasing at all. I think it's still worth investigating and fixing such that we don't need the dealiasing here.

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

If it passes the tests, it should be OK.

@odersky odersky merged commit 2584ab2 into scala:main Nov 25, 2025
45 checks passed
@odersky odersky deleted the mb/123752-b branch November 25, 2025 17:24
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.

"<type alias> does not take type parameters" when type parameter is same as the companion object for top-level type aliases

3 participants