Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Martres <[email protected]>
  • Loading branch information
odersky and smarter authored Oct 31, 2022
1 parent 854c35d commit 145d2ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/OrderingConstraint.scala
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,

override def dependsOn(tv: TypeVar, except: TypeVars, co: Boolean)(using Context): Boolean =
def origin(tv: TypeVar) =
assert(!tv.isInstantiated)
assert(!instType(tv).exists)
tv.origin
val param = origin(tv)
val excluded = except.map(origin)
Expand Down Expand Up @@ -694,7 +694,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
var newDepEntry = newEntry
replacedTypeVar match
case tvar: TypeVar =>
if tvar.isInstantiated
if tvar.inst.exists // `isInstantiated` would use ctx.typerState.constraint rather than the current constraint
then
// If the type variable has been instantiated, we need to forget about
// the instantiation for old dependencies.
Expand Down

0 comments on commit 145d2ba

Please sign in to comment.