-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Inconsistent lifting of receiver in macro #5119
Milestone
Comments
Blocked on this for xml interpolation |
allanrenucci
added a commit
to allanrenucci/jsx-interpolator
that referenced
this issue
Sep 18, 2018
Does not work with no splice. See scala/scala3#5119
This can be minimized to object Macro {
final class StringContextOps(sc: => StringContext) {
rewrite def ff(args: => Any*): String = sc.toString
}
implicit rewrite def XmlQuote(sc: => StringContext): StringContextOps = new StringContextOps(sc)
def test0 = ff"Hello World 0!"
def test1 = ff"Hello World 1 ${1}!"
def test2 = ff"Hello World 2 ${22} ${222}!"
} where in |
Note that this is still an issue after the introduction of |
So this is not as issue with Inlining but when typing object Test {
implicit class SCOps(ctx: StringContext) {
def foo(args: => Any*): String = ""
}
def test(name: String) = {
// {
// val $1$: Test.SCOps = SCOps(StringContext.apply(["Hello" : String]: String*))
// $1$.foo([ : Any]: Any*)
// }
foo"Hello"
// SCOps(StringContext.apply(["Hello ","" : String]: String*)).foo([name : Any]: Any*)
foo"Hello $name"
}
} |
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Oct 2, 2018
nicolasstucki
added a commit
that referenced
this issue
Oct 2, 2018
Fix #5119: Get underlying argument for synthetic local values
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Let's consider the following macro:
In the following use case:
the
Macro.impl
sees the receiversc
asas expected.
But now if my interpolator has no splice:
the receiver is lifted out and I only see a reference to it:
The text was updated successfully, but these errors were encountered: