Skip to content

Commit 2cc6b09

Browse files
committed
Fix #7395: Handle inlined repeated arguments
1 parent 45b6ebd commit 2cc6b09

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

library/src/scala/tasty/reflect/Printers.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -833,12 +833,10 @@ trait Printers
833833
case Typed(term, tpt) =>
834834
tpt.tpe match {
835835
case Types.Repeated(_) =>
836+
printTree(term)
836837
term match {
837-
case Repeated(_, _) =>
838-
printTree(term)
839-
case _ =>
840-
printTree(term)
841-
this += ": " += highlightTypeDef("_*")
838+
case Repeated(_, _) | Inlined(None, Nil, Repeated(_, _)) => this
839+
case _ => this += ": " += highlightTypeDef("_*")
842840
}
843841
case _ =>
844842
inParens {

tests/run-staging/i7381.check

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
scala.List.apply[scala.Int](1, 2, 3)

tests/run-staging/i7381.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import scala.quoted._
2+
import scala.quoted.staging._
3+
4+
object Test {
5+
6+
def main(args: Array[String]): Unit = {
7+
given Toolbox = Toolbox.make(getClass.getClassLoader)
8+
withQuoteContext {
9+
val expr = Expr(List(1, 2, 3))
10+
println(expr.show)
11+
}
12+
}
13+
14+
}

0 commit comments

Comments
 (0)