Skip to content

Commit

Permalink
Remove fixpoint computation of interpolateUndetVars
Browse files Browse the repository at this point in the history
This is not necessary now that `variances` includes a fixpoint
computation
  • Loading branch information
smarter committed Oct 25, 2016
1 parent a4ac5e0 commit f368dd5
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/dotty/tools/dotc/typer/Inferencing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ object Inferencing {
constr.println(s"qualifying undet vars: ${constraint.uninstVars filter qualifies map (tvar => s"$tvar / ${tvar.show}")}, constraint: ${constraint.show}")

val vs = variances(tp, qualifies)
var changed = false
val hasUnreportedErrors = ctx.typerState.reporter match {
case r: StoreReporter if r.hasErrors => true
case _ => false
Expand Down Expand Up @@ -253,17 +252,13 @@ object Inferencing {
if (v != 0) {
typr.println(s"interpolate ${if (v == 1) "co" else "contra"}variant ${tvar.show} in ${tp.show}")
tvar.instantiate(fromBelow = v == 1)
changed = true
}
}
if (changed) // instantiations might have uncovered new typevars to interpolate
interpolateUndetVars(tree, ownedBy)
else
for (tvar <- constraint.uninstVars)
if (!(vs contains tvar) && qualifies(tvar)) {
typr.println(s"instantiating non-occurring ${tvar.show} in ${tp.show} / $tp")
tvar.instantiate(fromBelow = true)
}
for (tvar <- constraint.uninstVars)
if (!(vs contains tvar) && qualifies(tvar)) {
typr.println(s"instantiating non-occurring ${tvar.show} in ${tp.show} / $tp")
tvar.instantiate(fromBelow = true)
}
}
if (constraint.uninstVars exists qualifies) interpolate()
}
Expand Down

0 comments on commit f368dd5

Please sign in to comment.