Skip to content

Commit 5e59f87

Browse files
committed
Fix a problem in IsFullyDefinedAccumulator
A maximized type variable could be instantiated to a type that contains more type variables. These have to be instantiated in turn.
1 parent 0c96231 commit 5e59f87

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,14 @@ object Inferencing {
150150
if !tvar.isInstantiated then
151151
instantiate(tvar, fromBelow = false)
152152
case nil =>
153-
val res = apply(true, tp)
154-
if res then maximize(toMaximize)
155-
res
153+
apply(true, tp)
154+
&& (
155+
toMaximize.isEmpty
156+
|| { maximize(toMaximize)
157+
toMaximize = Nil // Do another round since the maximixing instances
158+
process(tp) // might have type uninstantiated variables themselves.
159+
}
160+
)
156161
}
157162

158163
/** For all type parameters occurring in `tp`:

0 commit comments

Comments
 (0)