Skip to content

Commit 8644b4b

Browse files
committed
drop all kinds of WildcardType under useNecessaryEither
1 parent e2b212d commit 8644b4b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ trait ConstraintHandling {
102102
val dropWildcards = new ApproximatingTypeMap:
103103
if !isUpper then variance = -1
104104
def apply(t: Type): Type = t match
105-
case WildcardType if !allowWildcards =>
106-
range(param.underlying.loBound, param.underlying.hiBound)
105+
case t: WildcardType if !allowWildcards =>
106+
t.optBounds match
107+
case TypeBounds(lo, hi) => range(lo, hi)
108+
case _ => range(defn.NothingType, defn.AnyType)
107109
case _ =>
108110
mapOver(t)
109111
// Narrow one of the bounds of type parameter `param`

0 commit comments

Comments
 (0)