Skip to content

Commit dfcfb6b

Browse files
committed
Address review comment
1 parent d7521bf commit dfcfb6b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,13 @@ class TyperState() {
230230
val tvars = tl.paramRefs.map(other.typeVarOfParam(_)).collect { case tv: TypeVar => tv }
231231
if this.isCommittable then
232232
tvars.foreach(tvar =>
233-
if !tvar.inst.exists then
234-
if !isOwnedAnywhere(this, tvar) then includeVar(tvar)
235-
if constraint.isHard(tvar) then constraint = constraint.withHard(tvar))
233+
if !tvar.inst.exists && !isOwnedAnywhere(this, tvar) then includeVar(tvar))
236234
typeComparer.addToConstraint(tl, tvars)
237235
}) &&
238236
// Integrate the additional constraints on type variables from `other`
237+
// and merge hardness markers
239238
constraint.uninstVars.forall(tv =>
239+
if other.isHard(tv) then constraint = constraint.withHard(tv)
240240
val p = tv.origin
241241
val otherLos = other.lower(p)
242242
val otherHis = other.upper(p)

0 commit comments

Comments
 (0)