Skip to content

Commit 560846b

Browse files
Merge pull request #15401 from dotty-staging/fix-15400
Add regression tests
2 parents 2836fbc + 8c1d06e commit 560846b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import scala.quoted.{Expr, Quotes, Type}
2+
3+
object Macros {
4+
enum Free[A, B](using val typeDom: Type[A], val typeCod: Type[B]):
5+
case Id[A: Type]() extends Free[A,A]
6+
case Product[A: Type, B: Type, C: Type](f: Free[A,B], g: Free[A,C])(using quotes: Quotes)
7+
extends Free[A,(B,C)](using typeCod = Type.of[(B,C)])()
8+
9+
def test[A: Type]()(using quotes: Quotes): Expr[Unit] =
10+
val prod = Free.Product[A,A,A](Free.Id[A](), Free.Id[A]())
11+
'{ () }
12+
13+
inline def testInline[A](): Unit = ${ test[A]() }
14+
}

tests/pos-macros/i15400/Test_2.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@main def test = Macros.testInline[Int]()

0 commit comments

Comments
 (0)