diff options
Diffstat (limited to 'test/files/neg/macro-invalidusage-methodvaluesyntax')
-rw-r--r-- | test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala | 7 | ||||
-rw-r--r-- | test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala index 8d7fdf3e8a..776f8bf71c 100644 --- a/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala @@ -1,9 +1,8 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo(c: Ctx) = { + def foo(c: Context) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))) - c.Expr[Unit](body) + c.Expr[Unit](q"""println("it works")""") } }
\ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala index 343cec99b5..578aa45867 100644 --- a/test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala @@ -1,5 +1,5 @@ object Macros { - def foo = macro Impls.foo + def foo: Unit = macro Impls.foo } object Test extends App { |