Skip to content
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

Cannot define a macro with a parameter of a nested type #9811

Open
scabug opened this issue Jun 9, 2016 · 1 comment
Open

Cannot define a macro with a parameter of a nested type #9811

scabug opened this issue Jun 9, 2016 · 1 comment

Comments

@scabug
Copy link

scabug commented Jun 9, 2016

object MyMacro {
  import scala.language.experimental.macros
  trait NestedType
  def myMacro(t: NestedType): Unit = macro myMacro_imp
  def myMacro_imp(c: scala.reflect.macros.whitebox.Context)(t: c.Expr[NestedType]): c.Expr[Unit] = c.universe.reify(())
} 
Main.scala:692: macro implementation has incompatible shape:
 required: (c: scala.reflect.macros.whitebox.Context)(t: c.Expr[c.prefix.value.NestedType]): c.Expr[Unit]
 or      : (c: scala.reflect.macros.whitebox.Context)(t: c.Tree): c.Tree
 found   : (c: scala.reflect.macros.whitebox.Context)(t: c.Expr[cmd19.MyMacro.NestedType]): c.Expr[Unit]
type mismatch for parameter t: c.Expr[c.prefix.value.NestedType] does not conform to c.Expr[cmd19.MyMacro.NestedType]
  def myMacro(t: NestedType): Unit = macro myMacro_imp
                                           ^
@scabug
Copy link
Author

scabug commented Jun 9, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9811?orig=1
Reporter: @Atry
Affected Versions: 2.11.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant