diff --git a/compiler/testData/constraintSystem/checkStatus/conflictingConstraints.bounds b/compiler/testData/constraintSystem/checkStatus/conflictingConstraints.bounds index ca0e8e1b407..d54e4653ded 100644 --- a/compiler/testData/constraintSystem/checkStatus/conflictingConstraints.bounds +++ b/compiler/testData/constraintSystem/checkStatus/conflictingConstraints.bounds @@ -12,6 +12,7 @@ status: -hasContradiction: true -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: true -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: false diff --git a/compiler/testData/constraintSystem/checkStatus/successful.bounds b/compiler/testData/constraintSystem/checkStatus/successful.bounds index 5fc00e55296..583a8c21113 100644 --- a/compiler/testData/constraintSystem/checkStatus/successful.bounds +++ b/compiler/testData/constraintSystem/checkStatus/successful.bounds @@ -12,9 +12,10 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true result: -T=Int \ No newline at end of file +T=Int diff --git a/compiler/testData/constraintSystem/checkStatus/typeConstructorMismatch.bounds b/compiler/testData/constraintSystem/checkStatus/typeConstructorMismatch.bounds index 6748b94881d..1a59c9c2394 100644 --- a/compiler/testData/constraintSystem/checkStatus/typeConstructorMismatch.bounds +++ b/compiler/testData/constraintSystem/checkStatus/typeConstructorMismatch.bounds @@ -11,6 +11,7 @@ status: -hasContradiction: true -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: true +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: true -hasViolatedUpperBound: false -isSuccessful: false diff --git a/compiler/testData/constraintSystem/checkStatus/unknownParameters.bounds b/compiler/testData/constraintSystem/checkStatus/unknownParameters.bounds index 315a2e41147..d31138ba9ec 100644 --- a/compiler/testData/constraintSystem/checkStatus/unknownParameters.bounds +++ b/compiler/testData/constraintSystem/checkStatus/unknownParameters.bounds @@ -11,6 +11,7 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: true -hasViolatedUpperBound: false -isSuccessful: false diff --git a/compiler/testData/constraintSystem/checkStatus/violatedUpperBound.bounds b/compiler/testData/constraintSystem/checkStatus/violatedUpperBound.bounds index 2dd0cc822c1..c04981d28da 100644 --- a/compiler/testData/constraintSystem/checkStatus/violatedUpperBound.bounds +++ b/compiler/testData/constraintSystem/checkStatus/violatedUpperBound.bounds @@ -12,6 +12,7 @@ status: -hasContradiction: true -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: true -isSuccessful: false diff --git a/compiler/testData/constraintSystem/computeValues/contradiction.bounds b/compiler/testData/constraintSystem/computeValues/contradiction.bounds index ef0403037a0..efb7e8b91ae 100644 --- a/compiler/testData/constraintSystem/computeValues/contradiction.bounds +++ b/compiler/testData/constraintSystem/computeValues/contradiction.bounds @@ -12,6 +12,7 @@ status: -hasContradiction: true -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: true -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: false diff --git a/compiler/testData/constraintSystem/computeValues/subTypeOfUpperBounds.bounds b/compiler/testData/constraintSystem/computeValues/subTypeOfUpperBounds.bounds index 59267c02780..c186adc7a48 100644 --- a/compiler/testData/constraintSystem/computeValues/subTypeOfUpperBounds.bounds +++ b/compiler/testData/constraintSystem/computeValues/subTypeOfUpperBounds.bounds @@ -12,6 +12,7 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true diff --git a/compiler/testData/constraintSystem/computeValues/superTypeOfLowerBounds1.bounds b/compiler/testData/constraintSystem/computeValues/superTypeOfLowerBounds1.bounds index 67470527396..2f87b1baa2e 100644 --- a/compiler/testData/constraintSystem/computeValues/superTypeOfLowerBounds1.bounds +++ b/compiler/testData/constraintSystem/computeValues/superTypeOfLowerBounds1.bounds @@ -12,6 +12,7 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true diff --git a/compiler/testData/constraintSystem/computeValues/superTypeOfLowerBounds2.bounds b/compiler/testData/constraintSystem/computeValues/superTypeOfLowerBounds2.bounds index 611d210a64a..0b752ee190d 100644 --- a/compiler/testData/constraintSystem/computeValues/superTypeOfLowerBounds2.bounds +++ b/compiler/testData/constraintSystem/computeValues/superTypeOfLowerBounds2.bounds @@ -13,6 +13,7 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true diff --git a/compiler/testData/constraintSystem/integerValueTypes/byteOverflow.bounds b/compiler/testData/constraintSystem/integerValueTypes/byteOverflow.bounds index 7a95617b2aa..430a365cdaf 100644 --- a/compiler/testData/constraintSystem/integerValueTypes/byteOverflow.bounds +++ b/compiler/testData/constraintSystem/integerValueTypes/byteOverflow.bounds @@ -12,6 +12,7 @@ status: -hasContradiction: true -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: true -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: false diff --git a/compiler/testData/constraintSystem/integerValueTypes/defaultLong.bounds b/compiler/testData/constraintSystem/integerValueTypes/defaultLong.bounds index 3d82f18077a..2abed7f9db8 100644 --- a/compiler/testData/constraintSystem/integerValueTypes/defaultLong.bounds +++ b/compiler/testData/constraintSystem/integerValueTypes/defaultLong.bounds @@ -12,9 +12,10 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true result: -T=Long \ No newline at end of file +T=Long diff --git a/compiler/testData/constraintSystem/integerValueTypes/numberAndAny.bounds b/compiler/testData/constraintSystem/integerValueTypes/numberAndAny.bounds index 909959cb637..c65b5ee1928 100644 --- a/compiler/testData/constraintSystem/integerValueTypes/numberAndAny.bounds +++ b/compiler/testData/constraintSystem/integerValueTypes/numberAndAny.bounds @@ -12,9 +12,10 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true result: -T=Int \ No newline at end of file +T=Int diff --git a/compiler/testData/constraintSystem/integerValueTypes/numberAndString.bounds b/compiler/testData/constraintSystem/integerValueTypes/numberAndString.bounds index ab339288908..2b80c6cc94a 100644 --- a/compiler/testData/constraintSystem/integerValueTypes/numberAndString.bounds +++ b/compiler/testData/constraintSystem/integerValueTypes/numberAndString.bounds @@ -12,9 +12,10 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true result: -T=Comparable \ No newline at end of file +T=Comparable diff --git a/compiler/testData/constraintSystem/integerValueTypes/severalNumbers.bounds b/compiler/testData/constraintSystem/integerValueTypes/severalNumbers.bounds index 2ac118165c5..8a3bb3af4ad 100644 --- a/compiler/testData/constraintSystem/integerValueTypes/severalNumbers.bounds +++ b/compiler/testData/constraintSystem/integerValueTypes/severalNumbers.bounds @@ -12,9 +12,10 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true result: -T=Int \ No newline at end of file +T=Int diff --git a/compiler/testData/constraintSystem/integerValueTypes/simpleByte.bounds b/compiler/testData/constraintSystem/integerValueTypes/simpleByte.bounds index 6e09380a9ed..7668d5a7d25 100644 --- a/compiler/testData/constraintSystem/integerValueTypes/simpleByte.bounds +++ b/compiler/testData/constraintSystem/integerValueTypes/simpleByte.bounds @@ -12,9 +12,10 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true result: -T=Byte \ No newline at end of file +T=Byte diff --git a/compiler/testData/constraintSystem/integerValueTypes/simpleInt.bounds b/compiler/testData/constraintSystem/integerValueTypes/simpleInt.bounds index 5271316e2c3..4bf5959b522 100644 --- a/compiler/testData/constraintSystem/integerValueTypes/simpleInt.bounds +++ b/compiler/testData/constraintSystem/integerValueTypes/simpleInt.bounds @@ -11,9 +11,10 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true result: -T=Int \ No newline at end of file +T=Int diff --git a/compiler/testData/constraintSystem/integerValueTypes/simpleShort.bounds b/compiler/testData/constraintSystem/integerValueTypes/simpleShort.bounds index 44f7762efa6..1b31cf385cb 100644 --- a/compiler/testData/constraintSystem/integerValueTypes/simpleShort.bounds +++ b/compiler/testData/constraintSystem/integerValueTypes/simpleShort.bounds @@ -12,9 +12,10 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true result: -T=Short \ No newline at end of file +T=Short diff --git a/compiler/testData/constraintSystem/severalVariables/simpleDependency.bounds b/compiler/testData/constraintSystem/severalVariables/simpleDependency.bounds index 6b8c2fac7e7..b00387cb86b 100644 --- a/compiler/testData/constraintSystem/severalVariables/simpleDependency.bounds +++ b/compiler/testData/constraintSystem/severalVariables/simpleDependency.bounds @@ -3,8 +3,8 @@ VARIABLES T P SUBTYPE T Int type parameter bounds: -T <: Int -P <: Int +T >: P, <: Int +P <: T, <: Int status: -hasCannotCaptureTypesError: false @@ -12,10 +12,11 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true result: T=Int -P=Int \ No newline at end of file +P=Int diff --git a/compiler/testData/constraintSystem/variance/consumer.bounds b/compiler/testData/constraintSystem/variance/consumer.bounds index da63814af1c..f0c5d30a279 100644 --- a/compiler/testData/constraintSystem/variance/consumer.bounds +++ b/compiler/testData/constraintSystem/variance/consumer.bounds @@ -11,6 +11,7 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true diff --git a/compiler/testData/constraintSystem/variance/invariant.bounds b/compiler/testData/constraintSystem/variance/invariant.bounds index 5fd96d59eed..6e911a8ca3d 100644 --- a/compiler/testData/constraintSystem/variance/invariant.bounds +++ b/compiler/testData/constraintSystem/variance/invariant.bounds @@ -11,6 +11,7 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true diff --git a/compiler/testData/constraintSystem/variance/producer.bounds b/compiler/testData/constraintSystem/variance/producer.bounds index 0aaa43053f2..cc230ad432e 100644 --- a/compiler/testData/constraintSystem/variance/producer.bounds +++ b/compiler/testData/constraintSystem/variance/producer.bounds @@ -11,6 +11,7 @@ status: -hasContradiction: false -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false +-hasTypeInferenceIncorporationError: false -hasUnknownParameters: false -hasViolatedUpperBound: false -isSuccessful: true diff --git a/compiler/tests/org/jetbrains/kotlin/resolve/constraintSystem/AbstractConstraintSystemTest.kt b/compiler/tests/org/jetbrains/kotlin/resolve/constraintSystem/AbstractConstraintSystemTest.kt index e676fad2428..8ed593b72fb 100644 --- a/compiler/tests/org/jetbrains/kotlin/resolve/constraintSystem/AbstractConstraintSystemTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/resolve/constraintSystem/AbstractConstraintSystemTest.kt @@ -105,15 +105,14 @@ abstract public class AbstractConstraintSystemTest() : JetLiteFixture() { val resultingStatus = Renderers.RENDER_CONSTRAINT_SYSTEM_SHORT.render(constraintSystem) val resultingSubstitutor = constraintSystem.getResultingSubstitutor() - val result = StringBuilder() append "result:\n" - for (typeParameter in typeParameterDescriptors) { - val parameterType = testDeclarations.getType(typeParameter.getName().asString()) + val result = typeParameterDescriptors.map { + val parameterType = testDeclarations.getType(it.getName().asString()) val resultType = resultingSubstitutor.substitute(parameterType, Variance.INVARIANT) - result append "${typeParameter.getName()}=${resultType?.let{ DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(it) }}\n" - } + "${it.getName()}=${resultType?.let{ DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(it) }}" + }.join("\n", prefix = "result:\n") val boundsFile = File(filePath.replace("constraints", "bounds")) - JetTestUtils.assertEqualsToFile(boundsFile, "$constraintsFileText\n\n$resultingStatus\n\n$result\n") + JetTestUtils.assertEqualsToFile(boundsFile, "$constraintsFileText\n\n$resultingStatus\n\n$result") } class MyConstraint(val kind: MyConstraintKind, val firstType: String, val secondType: String, val isWeak: Boolean)