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

Check New tree for ill-formed module instantiations #17553

Merged
merged 1 commit into from
May 25, 2023

Conversation

nicolasstucki
Copy link
Contributor

Fixes #17545

override def typedNew(tree: untpd.New, pt: Type)(using Context): Tree =
val tree1 = super.typedNew(tree, pt).asInstanceOf[tpd.New]
val sym = tree1.tpe.typeSymbol
if !(ctx.phase <= postTyperPhase) then
Copy link
Member

Choose a reason for hiding this comment

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

this would be clearer as:

Suggested change
if !(ctx.phase <= postTyperPhase) then
if ctx.phase > postTyperPhase then

but could you add a comment explaining why this check is needed?

@smarter smarter assigned nicolasstucki and unassigned smarter May 24, 2023
@nicolasstucki nicolasstucki enabled auto-merge May 25, 2023 11:39
@nicolasstucki nicolasstucki merged commit 2e19304 into scala:main May 25, 2023
@nicolasstucki nicolasstucki deleted the fix-17545 branch May 25, 2023 11:42
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 1, 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.

Macro can invoke constructor of a case object
3 participants