summaryrefslogtreecommitdiff
path: root/test/files/run/t5923a-nofundep
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t5923a-nofundep')
-rw-r--r--test/files/run/t5923a-nofundep/Macros_1.scala14
-rw-r--r--test/files/run/t5923a-nofundep/Test_2.scala5
2 files changed, 19 insertions, 0 deletions
diff --git a/test/files/run/t5923a-nofundep/Macros_1.scala b/test/files/run/t5923a-nofundep/Macros_1.scala
new file mode 100644
index 0000000000..6d21362c4d
--- /dev/null
+++ b/test/files/run/t5923a-nofundep/Macros_1.scala
@@ -0,0 +1,14 @@
+import scala.reflect.macros.Context
+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: Context) = {
+ import c.universe._
+ reify(C[T](c.literal(weakTypeOf[T].toString).splice))
+ }
+} \ No newline at end of file
diff --git a/test/files/run/t5923a-nofundep/Test_2.scala b/test/files/run/t5923a-nofundep/Test_2.scala
new file mode 100644
index 0000000000..001ff9aea8
--- /dev/null
+++ b/test/files/run/t5923a-nofundep/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