-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Local suppression of errors raised by extra checks from -Xcheck-macros #13926
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
Comments
The documentation states that scope extrusions are invalid. Specifically this case. |
Sorry but then "This is again phase correct, but will lead us into trouble" is quite unclear. |
Then we will need to rephrase that sentence to make it clear. The point is that any kind of scope extrusions can leed to unsound code. In particular a |
Honestly, the current scope/ownership rules make mixing quotes |
An example where it compiled and run fine, but where
|
It looks like you are missing a - def appendDocCall(doc: Expr[BSONDocument]): Expr[MBuilder[BSONElement, Seq[BSONElement]]] = {
+ def appendDocCall(doc: Expr[BSONDocument])(using Quotes): Expr[MBuilder[BSONElement, Seq[BSONElement]]] = { The check indicates that in ${ appendDocCall('{ doc }) } the The |
If you mean that syntax like
|
No, I mean that This is the most common case for this failure and we could give a hint in the message if the We also need to add better documentation in the macro tutorial. |
The |
That bug is easily reproducible (3.1.1, 3.1.0) using documentation example |
Indeed, the example has a bug an |
Issue found in scala#13926 (comment) Tested in tests/run-macros/i8007/Macro_3.scala (already up to date).
Issue found in scala#13926 (comment) Tested in tests/run-macros/i8007/Macro_3.scala (already up to date).
@nicolasstucki I see you did update docs. Do you feel like those updates are enough to close this, or are more needed? |
As indicated in the documentation, some scope extrusion case like
'{ (x: Int) => ${ run('x); 1 } }
are valid, but if compiled with-Xcheck-macros
it will anyway raise a fatal error.Being able to locally suppress such error, not to have to globally disable
-Xcheck-macros
would be nicer.The text was updated successfully, but these errors were encountered: