Recursion depth in CommonSupertypes is bounded by maxDepth + 3

This commit is contained in:
Andrey Breslav
2014-08-27 16:13:47 +04:00
parent 364a7a6574
commit 12d18533e8
8 changed files with 195 additions and 11 deletions
@@ -3763,6 +3763,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("commonSupertype.kt")
public void testCommonSupertype() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/commonSupertype.kt");
doTest(fileName);
}
@TestMetadata("dontCreatePackageTypeForEnumEntry.kt")
public void testDontCreatePackageTypeForEnumEntry() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/dontCreatePackageTypeForEnumEntry.kt");
@@ -4437,6 +4443,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("recursive.kt")
public void testRecursive() throws Exception {
doTest("compiler/testData/diagnostics/tests/generics/recursive.kt");
}
@TestMetadata("RecursiveUpperBoundCheck.kt")
public void testRecursiveUpperBoundCheck() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.kt");
@@ -7763,6 +7774,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("recursiveGeneric.kt")
public void testRecursiveGeneric() throws Exception {
doTest("compiler/testData/diagnostics/tests/platformTypes/commonSupertype/recursiveGeneric.kt");
}
@TestMetadata("stringOrNull.kt")
public void testStringOrNull() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/platformTypes/commonSupertype/stringOrNull.kt");
@@ -204,6 +204,10 @@ public class JetTypeCheckerTest extends JetLiteFixture {
assertCommonSupertype("Base_T<out Parent>", "Base_T<A>", "Base_T<B>");
}
public void testCommonSupertypesForRecursive() throws Exception {
assertCommonSupertype("Rec<out Rec<out Rec<out Rec<out Rec<out Any?>>>>>", "ARec", "BRec");
}
public void testIntersect() throws Exception {
assertIntersection("Long", "Long?", "Number");
assertIntersection("Long", "Number", "Long?");