Skip to content

Commit 6af611b

Browse files
committed
Use underlyingIfRepeated instead of global substitutions
1 parent b2679f8 commit 6af611b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ class Typer extends Namer
581581
if (untpd.isWildcardStarArg(tree)) {
582582
def typedWildcardStarArgExpr = {
583583
val ptArg =
584-
if (ctx.mode.is(Mode.QuotedPattern)) pt.subst(defn.RepeatedParamClass :: Nil, defn.SeqType :: Nil)
584+
if (ctx.mode.is(Mode.QuotedPattern)) pt.underlyingIfRepeated(isJava = false)
585585
else WildcardType
586586
val tpdExpr = typedExpr(tree.expr, ptArg)
587587
tpdExpr.tpe.widenDealias match {
@@ -1969,7 +1969,9 @@ class Typer extends Namer
19691969
case Splice(pat) =>
19701970
try patternHole(tree)
19711971
finally {
1972-
val pat1 = pat.subst(defn.RepeatedParamClass :: Nil, defn.SeqClass :: Nil)
1972+
val patType = pat.tpe.widen
1973+
val patType1 = patType.underlyingIfRepeated(isJava = false)
1974+
val pat1 = if (patType eq patType1) pat else pat.withType(patType1)
19731975
patBuf += pat1
19741976
}
19751977
case _ =>

0 commit comments

Comments
 (0)