diff options
Diffstat (limited to 'tests/untried/pos/t8209b')
-rw-r--r-- | tests/untried/pos/t8209b/Macros_1.scala | 17 | ||||
-rw-r--r-- | tests/untried/pos/t8209b/Test_2.scala | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/untried/pos/t8209b/Macros_1.scala b/tests/untried/pos/t8209b/Macros_1.scala new file mode 100644 index 000000000..fa521d38d --- /dev/null +++ b/tests/untried/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 +} diff --git a/tests/untried/pos/t8209b/Test_2.scala b/tests/untried/pos/t8209b/Test_2.scala new file mode 100644 index 000000000..bedef776f --- /dev/null +++ b/tests/untried/pos/t8209b/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + val a: A = Macros.foo + val b: B = Macros.foo +} |