-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Missing macros to get Expr and raw source code of method arguments #5782
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
Partial fix for scala#5782: * get the ~raw code of arguments of the root context (in `def foo(s: Seq[Int])(implicit foo: Foo)`, with the implicit materialization of `Foo` backed by a macro - how can the macro get a String `"(1 to 10).sum"` in `f((1 to 10).sum)`?). Prevents to have `sourcecode.Text` work fine.
Partial fix for scala#5782: * get the ~raw code of arguments of the root context (in `def foo(s: Seq[Int])(implicit foo: Foo)`, with the implicit materialization of `Foo` backed by a macro - how can the macro get a String `"(1 to 10).sum"` in `f((1 to 10).sum)`?). Prevents to have `sourcecode.Text` work fine.
@alexarchambault is the addition in #5870 enough to implement this macro? |
@nicolasstucki I guess it is for the second point. Don't know about the first. |
Checking right now for the second point. |
For the first one you should try with |
So using About |
@alexarchambault could you create a self contained example that shows the desired result? |
This might be used to implement it https://github.com/lampepfl/dotty/blob/master/library/src/scala/compiletime/package.scala#L34 |
It's the main issue I ran into when porting sourcecode to dotty. It needs macros to
def foo(a: Int, b: String)(implicit foo: Foo)
with the implicit materialization ofFoo
backed by a macro - how can the macro getExpr
s for2
and"a"
inf(2, "a")
?). Prevents to havesourcecode.Args
work fine.def foo(s: Seq[Int])(implicit foo: Foo)
, with the implicit materialization ofFoo
backed by a macro - how can the macro get a String"(1 to 10).sum"
inf((1 to 10).sum)
?). Prevents to havesourcecode.Text
work fine.The text was updated successfully, but these errors were encountered: