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

Admit parametric aliases of classes in parent typing #18849

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 5, 2023

When typing parent types as constructors with implicitly added () arguments, also admit alias types that become classes after eta-collapsing.

Fixes #18623

When typing parent types as constructors with implicitly added `()` arguments,
also admit alias types that become classes after eta-collapsing.

Fixes scala#18623
class GoodNoParens[T](implicit ev: ForcedRecompilationToken[T])
type BadNoParens[T] = GoodNoParens[T]

// error
Copy link
Member

Choose a reason for hiding this comment

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

This is no longer an error, so we should delete this comment.

Copy link
Member

@noti0na1 noti0na1 left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

}
export x.GoodNoParens as BadNoParens

// error
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We usually leave the // error markers in the pos files. Less work to do, and it's useful to see what got fixed.

@odersky odersky merged commit 97afadf into scala:main Nov 6, 2023
18 checks passed
@odersky odersky deleted the fix-18623 branch November 6, 2023 19:12
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
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.

Spurious is not a class type error when inheriting a class without call parentheses() through a type alias
4 participants