You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue with this approach is that the apply macro doesn't see the tree for ctx and args as they are lifted out by the compiler and we only see references to the lifted values. To prevent parameters from being lifted out, one needs to make them by name:
#5096 implements the proposed solution. However, one should not need to make arguments by name to be able inspect the argument trees. So the proper solution should be:
The goal of this issue is to discuss how one could implement a macro based string interpolator similar to densh/joyquote:
Let's consider an hypothetical xml interpolator.
In Scala 2, one can write:
Let's see how this could translate to Dotty macros. A naive translation would be:
The issue with this approach is that the
apply
macro doesn't see the tree forctx
andargs
as they are lifted out by the compiler and we only see references to the lifted values. To prevent parameters from being lifted out, one needs to make them by name:The text was updated successfully, but these errors were encountered: