File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1094,6 +1094,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
1094
1094
*/
1095
1095
object WildcardPattern {
1096
1096
def unapply (pat : Tree ): Boolean = pat match {
1097
+ case Typed (_, arg) if arg.tpe.isRepeatedParam => true
1097
1098
case Bind (nme.WILDCARD , WildcardPattern ()) => true // don't skip when binding an interesting symbol!
1098
1099
case t if (tpd.isWildcardArg(t)) => true
1099
1100
case x : Ident => isVarPattern(x)
@@ -1157,8 +1158,8 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
1157
1158
1158
1159
object TypeBound {
1159
1160
def unapply (tree : Tree ): Option [Type ] = tree match {
1160
- case Typed (_, _) => Some (tree.typeOpt)
1161
- case _ => None
1161
+ case Typed (_, arg) if ! arg.tpe.isRepeatedParam => Some (tree.typeOpt)
1162
+ case _ => None
1162
1163
}
1163
1164
}
1164
1165
Original file line number Diff line number Diff line change @@ -427,7 +427,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
427
427
}
428
428
if (untpd.isWildcardStarArg(tree))
429
429
cases(
430
- ifPat = ascription(TypeTree (defn.SeqType .appliedTo(pt :: Nil )), isWildcard = true ),
430
+ // ifPat = ascription(TypeTree(defn.SeqType.appliedTo(pt :: Nil)), isWildcard = true),
431
+ ifPat = ascription(TypeTree (defn.RepeatedParamType .appliedTo(pt)), isWildcard = true ),
431
432
ifExpr = seqToRepeated(typedExpr(tree.expr, defn.SeqType )),
432
433
wildName = nme.WILDCARD_STAR )
433
434
else {
You can’t perform that action at this time.
0 commit comments