IR: Fix inner class type parameters in IrTypeSystemContext
This commit is contained in:
committed by
Alexander Udalov
parent
650469024e
commit
03651f1dd4
Generated
+5
@@ -14130,6 +14130,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerGenericClassFromJava.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerImplicitParameter.kt")
|
||||
public void testInnerImplicitParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerImplicitParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerJavaClass.kt")
|
||||
public void testInnerJavaClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerJavaClass.kt");
|
||||
|
||||
@@ -112,7 +112,7 @@ interface IrTypeSystemContext : TypeSystemContext, TypeSystemCommonSuperTypesCon
|
||||
private fun getTypeParameters(typeConstructor: TypeConstructorMarker): List<IrTypeParameter> {
|
||||
return when (typeConstructor) {
|
||||
is IrTypeParameterSymbol -> emptyList()
|
||||
is IrClassSymbol -> typeConstructor.owner.typeParameters
|
||||
is IrClassSymbol -> extractTypeParameters(typeConstructor.owner)
|
||||
else -> error("unsupported type constructor")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
open class C<T> {
|
||||
inner class A<U>(val x: T?, val y: U)
|
||||
|
||||
class D : C<Nothing>() {
|
||||
fun f() = A<String>(null, "OK")
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return C.D().f().y
|
||||
}
|
||||
+5
@@ -15350,6 +15350,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerGenericClassFromJava.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerImplicitParameter.kt")
|
||||
public void testInnerImplicitParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerImplicitParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerJavaClass.kt")
|
||||
public void testInnerJavaClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerJavaClass.kt");
|
||||
|
||||
+5
@@ -15350,6 +15350,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerGenericClassFromJava.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerImplicitParameter.kt")
|
||||
public void testInnerImplicitParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerImplicitParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerJavaClass.kt")
|
||||
public void testInnerJavaClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerJavaClass.kt");
|
||||
|
||||
+5
@@ -14130,6 +14130,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerGenericClassFromJava.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerImplicitParameter.kt")
|
||||
public void testInnerImplicitParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerImplicitParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerJavaClass.kt")
|
||||
public void testInnerJavaClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerJavaClass.kt");
|
||||
|
||||
Generated
+5
@@ -12285,6 +12285,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerGeneric.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerImplicitParameter.kt")
|
||||
public void testInnerImplicitParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerImplicitParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerLabeledThis.kt")
|
||||
public void testInnerLabeledThis() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerLabeledThis.kt");
|
||||
|
||||
Generated
+5
@@ -12295,6 +12295,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerGeneric.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerImplicitParameter.kt")
|
||||
public void testInnerImplicitParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerImplicitParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerLabeledThis.kt")
|
||||
public void testInnerLabeledThis() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerLabeledThis.kt");
|
||||
|
||||
+5
@@ -12360,6 +12360,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerGeneric.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerImplicitParameter.kt")
|
||||
public void testInnerImplicitParameter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerImplicitParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerLabeledThis.kt")
|
||||
public void testInnerLabeledThis() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/innerNested/innerLabeledThis.kt");
|
||||
|
||||
Reference in New Issue
Block a user