summaryrefslogtreecommitdiff
path: root/test/files/run/t5923a-nofundep/Macros_1.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t5923a-nofundep/Macros_1.scala')
-rw-r--r--test/files/run/t5923a-nofundep/Macros_1.scala14
1 files changed, 14 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