Skip to content

Do not allow calls to inline methods directly in macro splice #11746

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
Mar 17, 2021

Conversation

nicolasstucki
Copy link
Contributor

Also properly support canceled macro splices. These will warn the user and compile as if
they where a normal inline method.

Fixes #11688

Also properly support canceled macro splices. These will warn the user and compile as if
they where a normal inline method.

Fixes scala#11688
@nicolasstucki nicolasstucki marked this pull request as ready for review March 15, 2021 16:21
@nicolasstucki nicolasstucki changed the title Do not allow calls to inline metthods directly in macro splice Do not allow calls to inline methods directly in macro splice Mar 15, 2021
@Jasper-M
Copy link
Contributor

Then I guess you should also fix the error message which I quoted in #11688.

Emphasis mine:

Malformed macro.

Expected the splice ${...} to be at the top of the RHS:
inline def foo(inline x: X, ..., y: Y): Int = ${impl(x, ... '{y}})

  • The contents of the splice must call a static method
  • All arguments must be quoted or inline

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.

The same issue as pointed out by @Jasper-M . Otherwise, LGTM

It was written for an older version of the system.
@nicolasstucki nicolasstucki enabled auto-merge March 17, 2021 15:48
@nicolasstucki nicolasstucki merged commit da7aae2 into scala:master Mar 17, 2021
@nicolasstucki nicolasstucki deleted the fix-#11688 branch March 17, 2021 19:30
@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.

Macro parameter inconsistencies
4 participants