Skip to content

Commit 9304ed6

Browse files
liufengyunallanrenucci
authored andcommitted
fix failed test neg/i3248.scala
1 parent 3b93d98 commit 9304ed6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ object Applications {
115115
def names2 = List(nme.length, nme.apply, nme.drop, nme.toSeq)
116116
def types2 = List(lengthTp, applyTp(elemTp), dropTp(elemTp), toSeqTp(elemTp))
117117

118-
val valid = getTp <:< RefinedType.make(defn.AnyType, names1, types1) ||
119-
getTp <:< RefinedType.make(defn.AnyType, names2, types2)
118+
val valid = elemTp.exists &&
119+
(getTp <:< RefinedType.make(defn.AnyType, names1, types1) ||
120+
getTp <:< RefinedType.make(defn.AnyType, names2, types2))
120121

121122
if (valid) elemTp else NoType
122123
}

0 commit comments

Comments
 (0)