diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-10-08 06:30:21 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-10-08 06:33:26 +0200 |
commit | 0bf9daaac7ab46a3e9dd113565b0073eed95be59 (patch) | |
tree | 0ebb773a405678685d59c7f58d126c21dca93dea | |
parent | 65a321c63e5ddb77fa87de098c4f7d6f9ce8baa6 (diff) | |
download | scala-0bf9daaac7ab46a3e9dd113565b0073eed95be59.tar.gz scala-0bf9daaac7ab46a3e9dd113565b0073eed95be59.tar.bz2 scala-0bf9daaac7ab46a3e9dd113565b0073eed95be59.zip |
SI-6485 stops creating extmethods for macros
Macros don't correspond to bytecode-level methods, therefore
there's no need to undergo any transformations past typer.
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 2 | ||||
-rw-r--r-- | test/files/pos/t6485a/Macros_1.scala | 5 | ||||
-rw-r--r-- | test/files/pos/t6485a/Test_2.scala | 5 | ||||
-rw-r--r-- | test/files/pos/t6485b/Test.scala | 10 |
4 files changed, 21 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index c95678fa67..a6f156f947 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -654,7 +654,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => info.firstParent.typeSymbol == AnyValClass && !isPrimitiveValueClass final def isMethodWithExtension = - isMethod && owner.isDerivedValueClass && !isParamAccessor && !isConstructor && !hasFlag(SUPERACCESSOR) + isMethod && owner.isDerivedValueClass && !isParamAccessor && !isConstructor && !hasFlag(SUPERACCESSOR) && !isTermMacro final def isAnonymousFunction = isSynthetic && (name containsName tpnme.ANON_FUN_NAME) final def isDefinedInPackage = effectiveOwner.isPackageClass diff --git a/test/files/pos/t6485a/Macros_1.scala b/test/files/pos/t6485a/Macros_1.scala new file mode 100644 index 0000000000..85c2d5dbdb --- /dev/null +++ b/test/files/pos/t6485a/Macros_1.scala @@ -0,0 +1,5 @@ +import scala.reflect.macros.Context + +object Macros { + def crash(c: Context): c.Expr[Unit] = c.universe.reify(()) +}
\ No newline at end of file diff --git a/test/files/pos/t6485a/Test_2.scala b/test/files/pos/t6485a/Test_2.scala new file mode 100644 index 0000000000..54e260ac74 --- /dev/null +++ b/test/files/pos/t6485a/Test_2.scala @@ -0,0 +1,5 @@ +import scala.language.experimental.macros + +final class Ops[T](val x: T) extends AnyVal { + def f = macro Macros.crash +} diff --git a/test/files/pos/t6485b/Test.scala b/test/files/pos/t6485b/Test.scala new file mode 100644 index 0000000000..382df1c453 --- /dev/null +++ b/test/files/pos/t6485b/Test.scala @@ -0,0 +1,10 @@ +import scala.language.experimental.macros +import scala.reflect.macros.Context + +final class Ops[T](val x: T) extends AnyVal { + def f = macro Macros.crash +} + +object Macros { + def crash(c: Context): c.Expr[Unit] = c.universe.reify(()) +}
\ No newline at end of file |