diff options
Diffstat (limited to 'test/files/run/typecheck')
-rw-r--r-- | test/files/run/typecheck/Macros_1.scala | 11 | ||||
-rw-r--r-- | test/files/run/typecheck/Test_2.scala | 7 |
2 files changed, 4 insertions, 14 deletions
diff --git a/test/files/run/typecheck/Macros_1.scala b/test/files/run/typecheck/Macros_1.scala index 850a611ab1..ee1c8da763 100644 --- a/test/files/run/typecheck/Macros_1.scala +++ b/test/files/run/typecheck/Macros_1.scala @@ -1,16 +1,11 @@ -import scala.reflect.macros.Context +import scala.reflect.macros.whitebox._ import scala.language.experimental.macros object Macros { def impl(c: Context) = { import c.universe._ - val classDef = ClassDef( - Modifiers(), newTypeName("C"), List(), - Template( - List(Select(Ident(newTermName("scala")), newTypeName("AnyRef"))), emptyValDef, - List(DefDef(Modifiers(), nme.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR), List())), Literal(Constant(()))))))) - c.typeCheck(classDef) - c.Expr[Any](Literal(Constant(()))) + c.typecheck(q"class C") + q"()" } def foo: Any = macro impl diff --git a/test/files/run/typecheck/Test_2.scala b/test/files/run/typecheck/Test_2.scala index 0a3279e23e..01bf5198cc 100644 --- a/test/files/run/typecheck/Test_2.scala +++ b/test/files/run/typecheck/Test_2.scala @@ -6,10 +6,5 @@ object Test extends App { Macros.foo val tb = cm.mkToolBox() - val classDef = ClassDef( - Modifiers(), newTypeName("C"), List(), - Template( - List(Select(Ident(newTermName("scala")), newTypeName("AnyRef"))), emptyValDef, - List(DefDef(Modifiers(), nme.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR), List())), Literal(Constant(()))))))) - tb.typeCheck(classDef) + tb.typecheck(q"class C") }
\ No newline at end of file |