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

[macros] M7 => M8 regression when bundles and vanilla objects collide #8270

Closed
scabug opened this issue Feb 12, 2014 · 4 comments
Closed

[macros] M7 => M8 regression when bundles and vanilla objects collide #8270

scabug opened this issue Feb 12, 2014 · 4 comments

Comments

@scabug
Copy link

scabug commented Feb 12, 2014

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

class Macros(val c: Context) {
  def impl(x: c.Tree) = ???
}

object Macros {
  def impl(c: Context) = ???
}

object Test extends App {
  def foo: Unit = macro Macros.impl
}
22:24 ~/Projects/Master/sandbox (master)$ s
Test.scala:13: error: macro implementation has incompatible shape:
 required: : Macros.this.c.Expr[Unit]
 or      : : Macros.this.c.Tree
 found   : (x: Macros.this.c.Tree): Nothing
number of parameter sections differ
  def foo: Unit = macro Macros.impl
                               ^
one error found
@scabug
Copy link
Author

scabug commented Feb 12, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8270?orig=1
Reporter: @xeno-by
Affected Versions: 2.11.0-M8

@scabug
Copy link
Author

scabug commented Feb 12, 2014

@xeno-by said:
When deciding between a bundle and a vanilla object while resolving a macro impl ref, macro engine prioritizes the bundle even if it doesn't fit the bill.

@scabug
Copy link
Author

scabug commented Feb 12, 2014

@xeno-by said:
Not sure whether to qualify this as blocker or not. It's a regression, yes, but in quite a rare corner of macrology. There's a workaround, yes, but the error message is completely nuts. I think I'll mark it as a blocker, and you guys feel free to adjust.

@scabug
Copy link
Author

scabug commented Feb 13, 2014

@xeno-by said:
scala/scala#3521

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

2 participants