Skip to content

Commit 5627283

Browse files
committed
Remove Type#hasNonWildcard{LowerBound, UpperBound}
These are no longer needed since we stopped storing wildcards in constraints (see dropWildcards in ConstraintHandling#addOneBound).
1 parent faf9538 commit 5627283

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4615,20 +4615,6 @@ object Types {
46154615
/** For uninstantiated type variables: Is the upper bound different from Any? */
46164616
def hasUpperBound(using Context): Boolean = !currentEntry.hiBound.isRef(defn.AnyClass)
46174617

4618-
/** For uninstantiated type variables: Is the lower bound different from Nothing and
4619-
* does it not contain wildcard types?
4620-
*/
4621-
def hasNonWildcardLowerBound(using Context): Boolean =
4622-
val lo = currentEntry.loBound
4623-
!lo.isExactlyNothing && !lo.containsWildcardTypes
4624-
4625-
/** For uninstantiated type variables: Is the upper bound different from Any and
4626-
* does it not contain wildcard types?
4627-
*/
4628-
def hasNonWildcardUpperBound(using Context): Boolean =
4629-
val hi = currentEntry.hiBound
4630-
!hi.isRef(defn.AnyClass) && !hi.containsWildcardTypes
4631-
46324618
/** Unwrap to instance (if instantiated) or origin (if not), until result
46334619
* is no longer a TypeVar
46344620
*/

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ object Inferencing {
179179
&& {
180180
val direction = instDirection(tvar.origin)
181181
if minimizeSelected then
182-
if direction <= 0 && tvar.hasNonWildcardLowerBound then
182+
if direction <= 0 && tvar.hasLowerBound then
183183
instantiate(tvar, fromBelow = true)
184-
else if direction >= 0 && tvar.hasNonWildcardUpperBound then
184+
else if direction >= 0 && tvar.hasUpperBound then
185185
instantiate(tvar, fromBelow = false)
186186
// else hold off instantiating unbounded unconstrained variable
187187
else if direction != 0 then

0 commit comments

Comments
 (0)