Psi2Ir: Bind unbound type parameters
This commit is contained in:
committed by
Georgy Bronnikov
parent
8c4fdd1edd
commit
fc7d667282
Generated
+5
@@ -14356,6 +14356,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/javaInterop/lambdaInstanceOf.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("samUnboundTypeParameter.kt")
|
||||
public void testSamUnboundTypeParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/javaInterop/samUnboundTypeParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/javaInterop/generics")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
@@ -120,6 +120,8 @@ class DeclarationStubGenerator(
|
||||
generatePropertyStub(descriptor)
|
||||
is TypeAliasDescriptor ->
|
||||
generateTypeAliasStub(descriptor)
|
||||
is TypeParameterDescriptor ->
|
||||
generateOrGetTypeParameterStub(descriptor)
|
||||
else ->
|
||||
throw AssertionError("Unexpected member descriptor: $descriptor")
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ private val SymbolTable.allUnbound: List<IrSymbol>
|
||||
r.addAll(unboundSimpleFunctions)
|
||||
r.addAll(unboundProperties)
|
||||
r.addAll(unboundTypeAliases)
|
||||
r.addAll(unboundTypeParameters)
|
||||
return r
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// !LANGUAGE: -NewInference
|
||||
// WITH_RUNTIME
|
||||
// FILE: Base.java
|
||||
import java.lang.Runnable;
|
||||
import java.lang.IllegalStateException;
|
||||
|
||||
public class Base<T> {
|
||||
public <S> S add(Base<S> value, Runnable block) { return null; }
|
||||
}
|
||||
|
||||
// FILE: Derived.kt
|
||||
class Derived<T>(val value: T) : Base<T>() {
|
||||
init {
|
||||
add(this) {}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived("OK").value
|
||||
}
|
||||
+5
@@ -15571,6 +15571,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/javaInterop/lambdaInstanceOf.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("samUnboundTypeParameter.kt")
|
||||
public void testSamUnboundTypeParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/javaInterop/samUnboundTypeParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/javaInterop/generics")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+5
@@ -15571,6 +15571,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/javaInterop/lambdaInstanceOf.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("samUnboundTypeParameter.kt")
|
||||
public void testSamUnboundTypeParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/javaInterop/samUnboundTypeParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/javaInterop/generics")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+5
@@ -14356,6 +14356,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/javaInterop/lambdaInstanceOf.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("samUnboundTypeParameter.kt")
|
||||
public void testSamUnboundTypeParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/javaInterop/samUnboundTypeParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/javaInterop/generics")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user