Propagate input type position across incorporation properly

^KT-45719 Fixed
This commit is contained in:
Victor Petukhov
2021-03-26 17:01:26 +03:00
parent d06031ece3
commit 7f2c5cde55
6 changed files with 48 additions and 1 deletions
@@ -219,7 +219,8 @@ class ConstraintIncorporator(
val kind = if (isSubtype) ConstraintKind.LOWER else ConstraintKind.UPPER
val inputTypePosition = baseConstraint.position.from as? OnlyInputTypeConstraintPosition
val inputTypePosition =
baseConstraint.position.from as? OnlyInputTypeConstraintPosition ?: baseConstraint.inputTypePositionBeforeIncorporation
val isNewConstraintUsefulForNullability = isUsefulForNullabilityConstraint && newConstraint.isNullableNothing()
val isOtherConstraintUsefulForNullability = otherConstraint.isNullabilityConstraint && otherConstraint.type.isNullableNothing()