Skip to content

Commit d9df5ef

Browse files
committed
Tweaks
1 parent ff766a0 commit d9df5ef

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,12 @@ object Inferencing {
106106
case tvar: TypeVar
107107
if !tvar.isInstantiated && ctx.typerState.constraint.contains(tvar) =>
108108
force.appliesTo(tvar) && {
109-
val pref = tvar.origin
110-
val direction = instDirection(pref)
109+
val direction = instDirection(tvar.origin)
111110
def avoidBottom =
112111
!force.allowBottom &&
113-
defn.isBottomType(ctx.typeComparer.approximation(pref, fromBelow = true))
112+
defn.isBottomType(ctx.typeComparer.approximation(tvar.origin, fromBelow = true))
114113
def preferMin = force.minimizeAll || variance >= 0 && !avoidBottom
115-
if (direction != 0) instantiate(tvar, fromBelow = direction < 0)
114+
if (direction != 0) instantiate(tvar, direction < 0)
116115
else if (preferMin) instantiate(tvar, fromBelow = true)
117116
else toMaximize = true
118117
foldOver(x, tvar)

0 commit comments

Comments
 (0)