Skip to content

Heal type within quote internal encoding #11590

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

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

nicolasstucki
Copy link
Contributor

Fixes #11587

@nicolasstucki nicolasstucki self-assigned this Mar 3, 2021
@nicolasstucki nicolasstucki marked this pull request as ready for review March 3, 2021 19:51
@nicolasstucki nicolasstucki requested a review from liufengyun March 3, 2021 19:51
val targs1 = targs.map(targ => TypeTree(heal(targ.tpe)))
cpy.Apply(quote)(cpy.TypeApply(fn1)(fn0, targs1), body2 :: Nil)
case quote: TypeApply =>
cpy.TypeApply(quote)(quote.fun, body2 :: Nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

At line 119, body2 could be a block, and it's used as a type. I guess this case not reachable if body2 is a block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, is not reachable. This is essentially the same logic as in super.transformQuotation.

case AnnotatedType(parent, annot) => AnnotatedType(mapOver(parent), annot)
case _ => healTypeOfTerm(fn1.srcPos)(tp)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering why this is not already handled in the recursive call? Can it be handled in transform? I'm wondering if it's possible to avoid the heal TypeMap here and move the logic to healTypeOfTerm -- as there's also a TypeMap there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved into healTypeOfTerm

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

@nicolasstucki nicolasstucki merged commit 3bb16f8 into scala:master Mar 4, 2021
@nicolasstucki nicolasstucki deleted the fix-#11587-2 branch March 4, 2021 12:12
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 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.

Type not handled correctly in multistage quote
3 participants