-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cancel quotes while inlining #12193
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
Cancel quotes while inlining #12193
Conversation
tree match | ||
case Quoted(Spliced(inner)) => inner | ||
case _ => tree | ||
val res = cancelQuotes(constToLiteral(betaReduce(super.typedApply(tree, pt)))) match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix failed the following code:
inline def test[T](inline t: T): T = ${ identity('{ identity(${ identity('{ identity(${ identity('t) }) }) }) }) }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a different problem. I will open an issue for it. See #12225.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this one:
inline def test[T](inline t: T): T = ${ '{ ${ '{ ${ 't } } } } }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That one works. Added it as a regression test.
9d210f4
to
cbab359
Compare
The last top level splice is handled by the Splicer Fixes scala#12173
cbab359
to
2a97c3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The last top level splice is handled by the Splicer
Fixes #12173