Skip to content

Commit c91e998

Browse files
committed
Failing test for scala#13947
1 parent 16f9b22 commit c91e998

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

tests/run-macros/i13947.check

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
scala.Predef.String
2+
scala.Int, scala.Float, scala.Long

tests/run-macros/i13947/Macro_1.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import scala.quoted.*
2+
3+
inline def printTypeParams[A]: Unit = ${ printTypeParamsImpl[A] }
4+
5+
def printTypeParamsImpl[A: Type](using q: Quotes): Expr[Unit] = {
6+
import q.reflect.*
7+
8+
val tparams: List[TypeRepr] = TypeRepr.of[A].typeParams
9+
val debug = tparams.map(_.show).mkString(", ")
10+
11+
'{ println(${Expr(debug)}) }
12+
}

tests/run-macros/i13947/Test_2.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@main def Test: Unit =
2+
printTypeParams[Option[String]]
3+
printTypeParams[Function2[Int, Float, Long]]

0 commit comments

Comments
 (0)