Skip to content

Commit 1e3a643

Browse files
committed
use toSeq type as element type and check type
1 parent 1efdbe7 commit 1e3a643

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ object Applications {
100100
Nil
101101
}
102102

103-
def vaidUnapplySeqType(getTp: Type): Boolean = {
103+
def validUnapplySeqType(getTp: Type): Boolean = {
104104
def superType(elemTp: Type) = {
105105
val tps = List(
106106
MethodType(List("len".toTermName))(_ => defn.IntType :: Nil, _ => defn.IntType),
@@ -112,15 +112,15 @@ object Applications {
112112
RefinedType.make(defn.AnyType, names, tps)
113113
}
114114
getTp <:< superType(WildcardType) && {
115-
val seqArg = getTp.member(nme.toSeq).info.elemType.hiBound
115+
val seqArg = extractorMemberType(getTp, nme.toSeq).elemType.hiBound
116116
getTp <:< superType(seqArg)
117117
}
118118
}
119119

120120
if (unapplyName == nme.unapplySeq) {
121121
if (unapplyResult derivesFrom defn.SeqClass) seqSelector :: Nil
122-
else if (isGetMatch(unapplyResult, pos) && vaidUnapplySeqType(getTp)) {
123-
val seqArg = getTp.member(nme.apply).info.finalResultType
122+
else if (isGetMatch(unapplyResult, pos) && validUnapplySeqType(getTp)) {
123+
val seqArg = extractorMemberType(getTp, nme.toSeq).elemType.hiBound
124124
if (seqArg.exists) args.map(Function.const(seqArg))
125125
else fail
126126
}

0 commit comments

Comments
 (0)