Fixed infinite recursion

This commit is contained in:
Valentin Kipyatkov
2015-08-08 12:29:04 +03:00
parent 7f42c8b482
commit e3bca3010c
4 changed files with 26 additions and 2 deletions
@@ -0,0 +1,3 @@
class Class1<T : Class2<Class1<<!UNRESOLVED_REFERENCE!>X<!>>>>
class Class2<T : Class1<Class2<<!UNRESOLVED_REFERENCE!>X<!>>>>
@@ -0,0 +1,15 @@
package
internal final class Class1</*0*/ T : Class2<Class1<[ERROR : X]>>> {
public constructor Class1</*0*/ T : Class2<Class1<[ERROR : X]>>>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
internal final class Class2</*0*/ T : Class1<Class2<[ERROR : X]>>> {
public constructor Class2</*0*/ T : Class1<Class2<[ERROR : X]>>>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -11541,6 +11541,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("CycleInTypeArgs.kt")
public void testCycleInTypeArgs() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.kt");
doTest(fileName);
}
@TestMetadata("incompleteConstructorInvocation.kt")
public void testIncompleteConstructorInvocation() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/resolve/incompleteConstructorInvocation.kt");
@@ -82,12 +82,12 @@ public abstract class AbstractTypeParameterDescriptor extends DeclarationDescrip
)));
}
});
this.upperBounds = storageManager.createLazyValue(new Function0<Set<JetType>>() {
this.upperBounds = storageManager.createRecursionTolerantLazyValue(new Function0<Set<JetType>>() {
@Override
public Set<JetType> invoke() {
return resolveUpperBounds();
}
});
}, Collections.singleton(ErrorUtils.createErrorType("Recursion while calculating upper bounds")));
this.upperBoundsAsType = storageManager.createLazyValue(new Function0<JetType>() {
@Override
public JetType invoke() {