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

Macro expansion can't find inherited macro bundle impls #8437

Closed
scabug opened this issue Mar 22, 2014 · 3 comments
Closed

Macro expansion can't find inherited macro bundle impls #8437

scabug opened this issue Mar 22, 2014 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Mar 22, 2014

You can compile–but can't expand–macros that specify an inherited member of a macro bundle.

import scala.language.experimental.macros
import scala.reflect.macros._

abstract class AbstractBundle(val c: blackbox.Context) {
  import c.Expr
  import c.universe._
  def foo: Expr[Int] = Expr[Int](q"5")
}

class ConcreteBundle(override val c: blackbox.Context) extends AbstractBundle(c) {
  import c.Expr
  val bar: Expr[Int] = foo
}

object InvokeBundle {
  def foo: Int = macro ConcreteBundle.foo // nope
  def bar: Int = macro ConcreteBundle.bar // yep
}
scala> InvokeBundle.bar
res0: Int = 5

scala> InvokeBundle.foo
<console>:8: error: macro implementation not found: foo
(the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them)
              InvokeBundle.foo
                           ^
@scabug
Copy link
Author

@scabug scabug commented Mar 22, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8437?orig=1
Reporter: Chris Sachs (c9r)
Affected Versions: 2.11.0-RC1, 2.11.0-RC3

Loading

@scabug
Copy link
Author

@scabug scabug commented Mar 23, 2014

Loading

@scabug
Copy link
Author

@scabug scabug commented Mar 25, 2014

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants