Skip to content

Fix #6997: Adapt quote type direct aliase to type splice #7005

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 2 commits into from
Aug 23, 2019

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki marked this pull request as ready for review August 7, 2019 12:11
@nicolasstucki nicolasstucki requested a review from odersky August 7, 2019 12:14
@@ -112,6 +112,10 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
if (tp.isTerm)
ctx.error(i"splice outside quotes", pos)
tp
case tp: TypeRef if tp.prefix.derivesFrom(defn.QuotedTypeClass) && tp.name.toString == "T" =>
Copy link
Contributor

Choose a reason for hiding this comment

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

It's fragile and un-idiomatic to compare a name. If we have to do this, the name needs to be forge-proof (i.e. use $ characters in it, and there should be a fat comment in QuotedTypeClass that the type parameter name cannot be changed.

But I hope we do not need to do that, and that this works instead:

case tp: TypeRef if tp.symbol == defn.QuotedTypeClass.typeParams.head

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It worked with that change

@odersky odersky assigned nicolasstucki and unassigned odersky Aug 19, 2019
@odersky odersky merged commit b481635 into scala:master Aug 23, 2019
@odersky odersky deleted the fix-#6997 branch August 23, 2019 16:55
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.

2 participants