Skip to content

Commit 145d2ba

Browse files
oderskysmarter
andauthored
Apply suggestions from code review
Co-authored-by: Guillaume Martres <[email protected]>
1 parent 854c35d commit 145d2ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/core/OrderingConstraint.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
267267

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

0 commit comments

Comments
 (0)