diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/macro-blackbox-materialization.check | 3 | ||||
-rw-r--r-- | test/files/run/macro-blackbox-materialization/Macros_1.scala | 16 | ||||
-rw-r--r-- | test/files/run/macro-blackbox-materialization/Test_2.scala | 5 | ||||
-rw-r--r-- | test/files/run/macro-whitebox-fundep-materialization.check (renamed from test/files/run/t5923c.check) | 0 | ||||
-rw-r--r-- | test/files/run/macro-whitebox-fundep-materialization/Macros_1.scala (renamed from test/files/run/t5923c/Macros_1.scala) | 2 | ||||
-rw-r--r-- | test/files/run/macro-whitebox-fundep-materialization/Test_2.scala (renamed from test/files/run/t5923c/Test_2.scala) | 0 | ||||
-rw-r--r-- | test/files/run/t5923c.scala | 4 |
7 files changed, 29 insertions, 1 deletions
diff --git a/test/files/run/macro-blackbox-materialization.check b/test/files/run/macro-blackbox-materialization.check new file mode 100644 index 0000000000..7165b734ac --- /dev/null +++ b/test/files/run/macro-blackbox-materialization.check @@ -0,0 +1,3 @@ +C(Int) +C(String) +C(Nothing) diff --git a/test/files/run/macro-blackbox-materialization/Macros_1.scala b/test/files/run/macro-blackbox-materialization/Macros_1.scala new file mode 100644 index 0000000000..7c31dd7dc2 --- /dev/null +++ b/test/files/run/macro-blackbox-materialization/Macros_1.scala @@ -0,0 +1,16 @@ +// For the full version of the test, take a look at run/t5923a + +import scala.reflect.macros.BlackboxContext +import language.experimental.macros + +case class C[T](t: String) +object C { + implicit def foo[T]: C[T] = macro Macros.impl[T] +} + +object Macros { + def impl[T: c.WeakTypeTag](c: BlackboxContext) = { + import c.universe._ + reify(C[T](c.literal(weakTypeOf[T].toString).splice)) + } +}
\ No newline at end of file diff --git a/test/files/run/macro-blackbox-materialization/Test_2.scala b/test/files/run/macro-blackbox-materialization/Test_2.scala new file mode 100644 index 0000000000..001ff9aea8 --- /dev/null +++ b/test/files/run/macro-blackbox-materialization/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends App { + println(implicitly[C[Int]]) + println(implicitly[C[String]]) + println(implicitly[C[Nothing]]) +}
\ No newline at end of file diff --git a/test/files/run/t5923c.check b/test/files/run/macro-whitebox-fundep-materialization.check index bed7429108..bed7429108 100644 --- a/test/files/run/t5923c.check +++ b/test/files/run/macro-whitebox-fundep-materialization.check diff --git a/test/files/run/t5923c/Macros_1.scala b/test/files/run/macro-whitebox-fundep-materialization/Macros_1.scala index c86e14966b..671a4fff4e 100644 --- a/test/files/run/t5923c/Macros_1.scala +++ b/test/files/run/macro-whitebox-fundep-materialization/Macros_1.scala @@ -1,4 +1,4 @@ -import language.experimental.macros +import scala.language.experimental.macros import scala.reflect.macros.WhiteboxContext trait Iso[T, U] { diff --git a/test/files/run/t5923c/Test_2.scala b/test/files/run/macro-whitebox-fundep-materialization/Test_2.scala index a00f4ed7db..a00f4ed7db 100644 --- a/test/files/run/t5923c/Test_2.scala +++ b/test/files/run/macro-whitebox-fundep-materialization/Test_2.scala diff --git a/test/files/run/t5923c.scala b/test/files/run/t5923c.scala new file mode 100644 index 0000000000..956b256785 --- /dev/null +++ b/test/files/run/t5923c.scala @@ -0,0 +1,4 @@ +// see neg/macro-blackbox-fundep-materialization and run/macro-whitebox-fundep-materialization +object Test extends App { + // do nothing +}
\ No newline at end of file |