diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t7185.check | 4 | ||||
-rw-r--r-- | test/files/run/typecheck.check | 0 | ||||
-rw-r--r-- | test/files/run/typecheck/Macros_1.scala | 12 | ||||
-rw-r--r-- | test/files/run/typecheck/Test_2.scala | 10 |
4 files changed, 23 insertions, 3 deletions
diff --git a/test/files/run/t7185.check b/test/files/run/t7185.check index ebf85b731f..2b4adf36b4 100644 --- a/test/files/run/t7185.check +++ b/test/files/run/t7185.check @@ -24,9 +24,7 @@ tree: reflect.runtime.universe.Apply = scala> {val tb = reflect.runtime.currentMirror.mkToolBox(); tb.typecheck(tree): Any} res0: Any = { - { - $read.O.apply() - } + $read.O.apply() } scala> diff --git a/test/files/run/typecheck.check b/test/files/run/typecheck.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/files/run/typecheck.check diff --git a/test/files/run/typecheck/Macros_1.scala b/test/files/run/typecheck/Macros_1.scala new file mode 100644 index 0000000000..ee1c8da763 --- /dev/null +++ b/test/files/run/typecheck/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + c.typecheck(q"class C") + q"()" + } + + def foo: Any = macro impl +}
\ No newline at end of file diff --git a/test/files/run/typecheck/Test_2.scala b/test/files/run/typecheck/Test_2.scala new file mode 100644 index 0000000000..01bf5198cc --- /dev/null +++ b/test/files/run/typecheck/Test_2.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends App { + Macros.foo + + val tb = cm.mkToolBox() + tb.typecheck(q"class C") +}
\ No newline at end of file |