Prevent recursion on captured recursive type parameters of inner classes during computing bound for them

^KT-47459 Fixed
This commit is contained in:
Victor Petukhov
2021-06-28 16:15:02 +03:00
committed by TeamCityServer
parent e071281b20
commit ad89d43186
8 changed files with 90 additions and 2 deletions
@@ -21442,6 +21442,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/intermediateRecursion.kt");
}
@Test
@TestMetadata("kt47459.kt")
public void testKt47459() throws Exception {
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/kt47459.kt");
}
@Test
@TestMetadata("nonGenericRawMember.kt")
public void testNonGenericRawMember() throws Exception {
@@ -21442,6 +21442,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/intermediateRecursion.kt");
}
@Test
@TestMetadata("kt47459.kt")
public void testKt47459() throws Exception {
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/kt47459.kt");
}
@Test
@TestMetadata("nonGenericRawMember.kt")
public void testNonGenericRawMember() throws Exception {
@@ -0,0 +1,24 @@
// FIR_IDENTICAL
// FILE: MapObjectManager.java
abstract class MapObjectManager<C extends MapObjectManager.Collection> {
public class Collection {
}
public C getCollection(String id) {
return null;
}
}
// FILE: MarkerManager.java
public class MarkerManager extends MapObjectManager<MarkerManager.Collection> {
public class Collection extends MapObjectManager.Collection {
public void setOnMarkerClickListener() {
}
}
}
// FILE: main.kt
fun foo(markerManager: MarkerManager) {
val test: MarkerManager.Collection = markerManager.getCollection("FOO")!!
test.setOnMarkerClickListener()
}
@@ -0,0 +1,34 @@
package
public fun foo(/*0*/ markerManager: MarkerManager): kotlin.Unit
public/*package*/ abstract class MapObjectManager</*0*/ C : MapObjectManager<(raw) MapObjectManager<*>.Collection>.Collection!> {
public/*package*/ constructor MapObjectManager</*0*/ C : MapObjectManager<(raw) MapObjectManager<*>.Collection>.Collection!>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open fun getCollection(/*0*/ id: kotlin.String!): C!
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public open inner class Collection /*captured type parameters: /*0*/ C : MapObjectManager<(raw) MapObjectManager<*>.Collection>.Collection!*/ {
public constructor Collection()
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
}
}
public open class MarkerManager : MapObjectManager<MarkerManager.Collection!> {
public constructor MarkerManager()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun getCollection(/*0*/ id: kotlin.String!): MarkerManager.Collection!
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public open inner class Collection : MapObjectManager<(raw) MapObjectManager<*>.Collection!>.Collection {
public constructor Collection()
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 fun setOnMarkerClickListener(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
@@ -21448,6 +21448,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/intermediateRecursion.kt");
}
@Test
@TestMetadata("kt47459.kt")
public void testKt47459() throws Exception {
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/kt47459.kt");
}
@Test
@TestMetadata("nonGenericRawMember.kt")
public void testNonGenericRawMember() throws Exception {