Fix stack overflow caused star projection
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
class A<T : A<T>>
|
||||
fun <T : A<*>> foo() {}
|
||||
class B<T : A<*>>
|
||||
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T : A<*>> foo(): kotlin.Unit
|
||||
|
||||
public final class A</*0*/ T : A<T>> {
|
||||
public constructor A</*0*/ T : A<T>>()
|
||||
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 final class B</*0*/ T : A<*>> {
|
||||
public constructor B</*0*/ T : A<*>>()
|
||||
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
|
||||
}
|
||||
@@ -7439,6 +7439,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/generics/starProjections"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("checkBounds.kt")
|
||||
public void testCheckBounds() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/generics/starProjections/checkBounds.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("collectionInheritedFromJava.kt")
|
||||
public void testCollectionInheritedFromJava() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/generics/starProjections/collectionInheritedFromJava.kt");
|
||||
|
||||
@@ -171,6 +171,8 @@ public class TypeUtils {
|
||||
for (int i = 0, parametersSize = parameters.size(); i < parametersSize; i++) {
|
||||
TypeParameterDescriptor parameterDescriptor = parameters.get(i);
|
||||
TypeProjection typeProjection = arguments.get(i);
|
||||
if (typeProjection.isStarProjection()) return true;
|
||||
|
||||
Variance projectionKind = typeProjection.getProjectionKind();
|
||||
KotlinType argument = typeProjection.getType();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user