Don't generate constraint if a type variable was substituted twice
to prevent infinite recursion
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
VARIABLES T P E
|
||||
|
||||
SUBTYPE T Producer<P>
|
||||
SUBTYPE P Producer<E>
|
||||
SUBTYPE E Producer<P>
|
||||
|
||||
type parameter bounds:
|
||||
T <: Producer<P>*, <: Producer<Producer<E>>*, <: Producer<Producer<Producer<P>>>*
|
||||
P <: Producer<E>*
|
||||
E <: Producer<P>*
|
||||
|
||||
status:
|
||||
-hasCannotCaptureTypesError: false
|
||||
-hasConflictingConstraints: false
|
||||
-hasContradiction: false
|
||||
-hasErrorInConstrainingTypes: false
|
||||
-hasTypeConstructorMismatch: false
|
||||
-hasTypeInferenceIncorporationError: false
|
||||
-hasUnknownParameters: true
|
||||
-hasViolatedUpperBound: false
|
||||
-isSuccessful: false
|
||||
|
||||
result:
|
||||
T=???
|
||||
P=???
|
||||
E=???
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
VARIABLES T P E
|
||||
|
||||
SUBTYPE T Producer<P>
|
||||
SUBTYPE P Producer<E>
|
||||
SUBTYPE E Producer<P>
|
||||
+6
@@ -441,6 +441,12 @@ public class ConstraintSystemTestGenerated extends AbstractConstraintSystemTest
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/constraintSystem/severalVariables/recursive"), Pattern.compile("^(.+)\\.constraints$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("implicitlyRecursive.constraints")
|
||||
public void testImplicitlyRecursive() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/recursive/implicitlyRecursive.constraints");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("mutuallyRecursive.constraints")
|
||||
public void testMutuallyRecursive() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/recursive/mutuallyRecursive.constraints");
|
||||
|
||||
Reference in New Issue
Block a user