We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38135f3 commit 748da85Copy full SHA for 748da85
compiler/src/dotty/tools/dotc/typer/Inferencing.scala
@@ -108,12 +108,9 @@ object Inferencing {
108
&& ctx.typerState.constraint.contains(tvar)
109
&& {
110
val direction = instDirection(tvar.origin)
111
- def avoidBottom =
112
- !force.allowBottom &&
113
- defn.isBottomType(ctx.typeComparer.approximation(tvar.origin, fromBelow = true))
114
def preferMin =
115
- force.minimizeAll && (!avoidBottom || !tvar.hasUpperBound)
116
- || variance >= 0 && !avoidBottom
+ force.minimizeAll && (tvar.hasLowerBound || !tvar.hasUpperBound)
+ || variance >= 0 && (force.allowBottom || tvar.hasLowerBound)
117
if (direction != 0) instantiate(tvar, direction < 0)
118
else if (preferMin) instantiate(tvar, fromBelow = true)
119
else toMaximize = true
0 commit comments