diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t8209a.check | 0 | ||||
-rw-r--r-- | test/files/pos/t8209a/Macros_1.scala | 17 | ||||
-rw-r--r-- | test/files/pos/t8209a/Test_2.scala | 4 | ||||
-rw-r--r-- | test/files/pos/t8209b.check | 0 | ||||
-rw-r--r-- | test/files/pos/t8209b/Macros_1.scala | 17 | ||||
-rw-r--r-- | test/files/pos/t8209b/Test_2.scala | 4 |
6 files changed, 42 insertions, 0 deletions
diff --git a/test/files/pos/t8209a.check b/test/files/pos/t8209a.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/files/pos/t8209a.check diff --git a/test/files/pos/t8209a/Macros_1.scala b/test/files/pos/t8209a/Macros_1.scala new file mode 100644 index 0000000000..17014b4744 --- /dev/null +++ b/test/files/pos/t8209a/Macros_1.scala @@ -0,0 +1,17 @@ +import scala.language.experimental.macros +import scala.language.implicitConversions +import scala.reflect.macros.blackbox.Context + +class A +object A { implicit def a2b(a: A): B = ??? } +class B +class C extends A + +object Macros { + def impl(c: Context) = { + import c.universe._ + q"new C" + } + + def foo: A = macro impl +}
\ No newline at end of file diff --git a/test/files/pos/t8209a/Test_2.scala b/test/files/pos/t8209a/Test_2.scala new file mode 100644 index 0000000000..e19d572f55 --- /dev/null +++ b/test/files/pos/t8209a/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + val a: A = Macros.foo + val b: B = Macros.foo +}
\ No newline at end of file diff --git a/test/files/pos/t8209b.check b/test/files/pos/t8209b.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/files/pos/t8209b.check diff --git a/test/files/pos/t8209b/Macros_1.scala b/test/files/pos/t8209b/Macros_1.scala new file mode 100644 index 0000000000..705f7d630c --- /dev/null +++ b/test/files/pos/t8209b/Macros_1.scala @@ -0,0 +1,17 @@ +import scala.language.experimental.macros +import scala.language.implicitConversions +import scala.reflect.macros.whitebox.Context + +class A +object A { implicit def a2b(a: A): B = ??? } +class B +class C extends A + +object Macros { + def impl(c: Context) = { + import c.universe._ + q"new C" + } + + def foo: A = macro impl +}
\ No newline at end of file diff --git a/test/files/pos/t8209b/Test_2.scala b/test/files/pos/t8209b/Test_2.scala new file mode 100644 index 0000000000..e19d572f55 --- /dev/null +++ b/test/files/pos/t8209b/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + val a: A = Macros.foo + val b: B = Macros.foo +}
\ No newline at end of file |