Skip to content

Commit

Permalink
Reuse equality constraints during simplification in adding constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
petukhovv committed Nov 25, 2020
1 parent aabe709 commit 616e40f
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,16 @@ class MutableVariableWithConstraints private constructor(
ConstraintKind.EQUALITY -> true
}
if (isMatchingForSimplification) {
val actualConstraint = Constraint(
ConstraintKind.EQUALITY,
constraint.type,
constraint.position,
constraint.typeHashCode,
derivedFrom = constraint.derivedFrom,
isNullabilityConstraint = false
)
val actualConstraint = if (constraint.kind != ConstraintKind.EQUALITY) {
Constraint(
ConstraintKind.EQUALITY,
constraint.type,
constraint.position,
constraint.typeHashCode,
derivedFrom = constraint.derivedFrom,
isNullabilityConstraint = false
)
} else constraint
mutableConstraints.add(actualConstraint)
simplifiedConstraints = null
return actualConstraint
Expand Down

0 comments on commit 616e40f

Please sign in to comment.