diff --git a/tests/pos-macros/i15400/Macros_1.scala b/tests/pos-macros/i15400/Macros_1.scala new file mode 100644 index 000000000000..07cee32f040d --- /dev/null +++ b/tests/pos-macros/i15400/Macros_1.scala @@ -0,0 +1,14 @@ +import scala.quoted.{Expr, Quotes, Type} + +object Macros { + enum Free[A, B](using val typeDom: Type[A], val typeCod: Type[B]): + case Id[A: Type]() extends Free[A,A] + case Product[A: Type, B: Type, C: Type](f: Free[A,B], g: Free[A,C])(using quotes: Quotes) + extends Free[A,(B,C)](using typeCod = Type.of[(B,C)])() + + def test[A: Type]()(using quotes: Quotes): Expr[Unit] = + val prod = Free.Product[A,A,A](Free.Id[A](), Free.Id[A]()) + '{ () } + + inline def testInline[A](): Unit = ${ test[A]() } +} diff --git a/tests/pos-macros/i15400/Test_2.scala b/tests/pos-macros/i15400/Test_2.scala new file mode 100644 index 000000000000..b4848da47e67 --- /dev/null +++ b/tests/pos-macros/i15400/Test_2.scala @@ -0,0 +1 @@ +@main def test = Macros.testInline[Int]()