Skip to content

Commit 09ce7f5

Browse files
committed
Update documentation & tests
1 parent b541465 commit 09ce7f5

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

library/src/scala/quoted/Quotes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2571,7 +2571,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
25712571
@experimental
25722572
def substituteTypes(from: List[Symbol], to: List[TypeRepr]): TypeRepr
25732573

2574-
/** The type parameters */
2574+
/** The applied type parameters (empty if there is no such parameters) */
25752575
@experimental
25762576
def typeParams: List[TypeRepr]
25772577
end extension

tests/run-macros/i13947.check

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

tests/run-macros/i13947/Macro_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def printTypeParamsImpl[A: Type](using q: Quotes): Expr[Unit] = {
66
import q.reflect.*
77

88
val tparams: List[TypeRepr] = TypeRepr.of[A].typeParams
9-
val debug = tparams.map(_.show).mkString(", ")
9+
val debug = tparams.map(_.show).mkString("[", ", ", "]")
1010

1111
'{ println(${Expr(debug)}) }
1212
}

tests/run-macros/i13947/Test_2.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
@main def Test: Unit =
2+
printTypeParams[scala.util.Random]
23
printTypeParams[Option[String]]
34
printTypeParams[Function2[Int, Float, Long]]

0 commit comments

Comments
 (0)