Skip to content

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

Merged
merged 1 commit into from
Apr 27, 2021
Merged

Conversation

nicolasstucki
Copy link
Contributor

The last top level splice is handled by the Splicer

Fixes #12173

@nicolasstucki nicolasstucki marked this pull request as ready for review April 23, 2021 10:44
tree match
case Quoted(Spliced(inner)) => inner
case _ => tree
val res = cancelQuotes(constToLiteral(betaReduce(super.typedApply(tree, pt)))) match {
Copy link
Contributor

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) }) }) }) }) }

Copy link
Contributor Author

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.

Copy link
Contributor

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 } } } } }

Copy link
Contributor Author

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.

The last top level splice is handled by the Splicer

Fixes scala#12173
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 enabled auto-merge April 27, 2021 08:11
@nicolasstucki nicolasstucki merged commit 73bb6c7 into scala:master Apr 27, 2021
@nicolasstucki nicolasstucki deleted the fix-#12173 branch April 27, 2021 08:32
@Kordyjan Kordyjan added this to the 3.0.1 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.

"assertion failed: unexpected top splice outside quote" when splicing & quoting multiple times
3 participants