Permalink
Browse files

SI-5894 Don't emit static forwarders for macros.

  • Loading branch information...
1 parent b828e32 commit a23cc20ed5d3795584cb9ed74c0cd4bda25c2df1 @retronym retronym committed Dec 5, 2012
Showing with 18 additions and 1 deletion.
  1. +1 −1 src/compiler/scala/tools/nsc/backend/jvm/GenJVMASM.scala
  2. +17 −0 test/files/run/t5894.scala
@@ -36,7 +36,7 @@ trait GenJVMASM {
protected val ExcludedForwarderFlags = {
import Flags._
// Should include DEFERRED but this breaks findMember.
- ( CASE | SPECIALIZED | LIFTED | PROTECTED | STATIC | EXPANDEDNAME | BridgeAndPrivateFlags )
+ ( CASE | SPECIALIZED | LIFTED | PROTECTED | STATIC | EXPANDEDNAME | BridgeAndPrivateFlags | MACRO )
}
protected def isJavaEntryPoint(icls: IClass) = {
View
@@ -0,0 +1,17 @@
+import language.experimental.macros
+
+class Test
+
+object Test {
+ def foo = macro fooImpl
+ def fooImpl(c: reflect.macros.Context) = c.literalUnit
+
+ def main(args: Array[String]) {
+ try {
+ val method = classOf[Test].getMethod("foo")
+ sys.error("Static forwarder generated for macro: " + method)
+ } catch {
+ case _: NoSuchMethodException => // okay
+ }
+ }
+}

0 comments on commit a23cc20

Please sign in to comment.