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
call to nullary, polymorphic macro without explicit type argument lead to NoSuchMethodError #5692
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5692?orig=1 |
@xeno-by said: |
@retronym said: scala> decl
<console>:11: error: macro has not been expanded
decl
^ |
@xeno-by said: The original bug was caused by the fact that polymorphic expansions with undetermined params are delayed until params get inferred. This works in a lot of cases, except of this one that I overlooked. Interaction of undetParams and macros will be revised anyways, when I get to implicit macros (hopefully, before M4), so for now I added a "macro has not been expanded" sanity check akin to "erroneous or inaccessible type". Of course, this change doesn't prevent a bug, but at least it makes the bug apparent during compile-time, not during the runtime. |
@xeno-by said (edited on Sep 17, 2012 10:30:43 PM UTC): |
@Blaisorblade said (edited on Sep 2, 2012 3:20:38 PM UTC): Below an updated REPL session (with a number of small changes due to updates to the macro API). scala> import language.experimental.macros
import language.experimental.macros
cala> def impl[A](c: reflect.macros.Context) = c.universe.reify(())
impl: [A](c: scala.reflect.macros.Context)c.universe.Expr[Unit]
scala> def decl[A] = macro impl[A]
decl: [A]=> Unit
scala> decl[Any]
scala> decl
<console>:11: error: macro has not been expanded
decl
^ |
@xeno-by said: |
@xeno-by said: |
@xeno-by said: |
The text was updated successfully, but these errors were encountered: