Updated constraint system tests
This commit is contained in:
@@ -12,6 +12,7 @@ status:
|
||||
-hasContradiction: true
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: true
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: false
|
||||
|
||||
@@ -12,9 +12,10 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
result:
|
||||
T=Int
|
||||
T=Int
|
||||
|
||||
@@ -11,6 +11,7 @@ status:
|
||||
-hasContradiction: true
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: true
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: true
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: false
|
||||
|
||||
@@ -11,6 +11,7 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: true
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: false
|
||||
|
||||
@@ -12,6 +12,7 @@ status:
|
||||
-hasContradiction: true
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: true
|
||||
-isSuccessful: false
|
||||
|
||||
@@ -12,6 +12,7 @@ status:
|
||||
-hasContradiction: true
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: true
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: false
|
||||
|
||||
@@ -12,6 +12,7 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
+1
@@ -12,6 +12,7 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
+1
@@ -13,6 +13,7 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
@@ -12,6 +12,7 @@ status:
|
||||
-hasContradiction: true
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: true
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: false
|
||||
|
||||
@@ -12,9 +12,10 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
result:
|
||||
T=Long
|
||||
T=Long
|
||||
|
||||
@@ -12,9 +12,10 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
result:
|
||||
T=Int
|
||||
T=Int
|
||||
|
||||
+2
-1
@@ -12,9 +12,10 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
result:
|
||||
T=Comparable<out Any?>
|
||||
T=Comparable<out Any?>
|
||||
|
||||
@@ -12,9 +12,10 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
result:
|
||||
T=Int
|
||||
T=Int
|
||||
|
||||
@@ -12,9 +12,10 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
result:
|
||||
T=Byte
|
||||
T=Byte
|
||||
|
||||
@@ -11,9 +11,10 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
result:
|
||||
T=Int
|
||||
T=Int
|
||||
|
||||
@@ -12,9 +12,10 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
result:
|
||||
T=Short
|
||||
T=Short
|
||||
|
||||
+4
-3
@@ -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
|
||||
P=Int
|
||||
|
||||
@@ -11,6 +11,7 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
@@ -11,6 +11,7 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
@@ -11,6 +11,7 @@ status:
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: false
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: true
|
||||
|
||||
+5
-6
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user