diff options
-rw-r--r-- | src/compiler/scala/reflect/macros/compiler/DefaultMacroCompiler.scala | 2 | ||||
-rw-r--r-- | test/files/pos/t8523.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t8523.scala | 10 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/compiler/scala/reflect/macros/compiler/DefaultMacroCompiler.scala b/src/compiler/scala/reflect/macros/compiler/DefaultMacroCompiler.scala index 1413065a27..a13a778b2f 100644 --- a/src/compiler/scala/reflect/macros/compiler/DefaultMacroCompiler.scala +++ b/src/compiler/scala/reflect/macros/compiler/DefaultMacroCompiler.scala @@ -53,7 +53,7 @@ abstract class DefaultMacroCompiler extends Resolvers (EmptyTree, TermName(""), Nil) } val bundleImplRef = MacroImplRefCompiler( - atPos(macroDdef.rhs.pos)(gen.mkTypeApply(Select(New(maybeBundleRef, List(List(Ident(Predef_???)))), methName), targs)), + atPos(macroDdef.rhs.pos)(gen.mkTypeApply(Select(New(maybeBundleRef, List(List(Literal(Constant(null))))), methName), targs)), isImplBundle = true ) val vanillaResult = tryCompile(vanillaImplRef) diff --git a/test/files/pos/t8523.flags b/test/files/pos/t8523.flags new file mode 100644 index 0000000000..c7d406c649 --- /dev/null +++ b/test/files/pos/t8523.flags @@ -0,0 +1 @@ +-Ywarn-dead-code -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/t8523.scala b/test/files/pos/t8523.scala new file mode 100644 index 0000000000..dfcb35404d --- /dev/null +++ b/test/files/pos/t8523.scala @@ -0,0 +1,10 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +class Impl(val c: Context) { + def impl: c.Tree = ??? +} + +object Macros { + def foo: Any = macro Impl.impl +}
\ No newline at end of file |