K2: Fix deserialization of upper bound of type parameter in nested class

Previously, containingDeclarationSymbol for V was set to the outer class
BaseRoot, so its upper bounds was computed to the ones from TNested
at org.jetbrains.kotlin.fir.resolve.calls.CreateFreshTypeVariableSubstitutorStageKt.getTypeParameterFromExpandedClass

^KT-56706 Fixed
This commit is contained in:
Denis.Zharkov
2023-02-17 18:24:23 +01:00
committed by Space Team
parent 9f51d3fbeb
commit 0c9fad87c3
15 changed files with 100 additions and 2 deletions
@@ -13544,6 +13544,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
public void testFalsePositiveBoundSmartcast() throws Exception {
runTest("compiler/testData/codegen/box/fir/falsePositiveBoundSmartcast.kt");
}
@Test
@TestMetadata("nestedClassTypeParameterDeserialization.kt")
public void testNestedClassTypeParameterDeserialization() throws Exception {
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
}
}
@Nested
@@ -13640,6 +13640,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
public void testFalsePositiveBoundSmartcast() throws Exception {
runTest("compiler/testData/codegen/box/fir/falsePositiveBoundSmartcast.kt");
}
@Test
@TestMetadata("nestedClassTypeParameterDeserialization.kt")
public void testNestedClassTypeParameterDeserialization() throws Exception {
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
}
}
@Nested
@@ -13640,6 +13640,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
public void testFalsePositiveBoundSmartcast() throws Exception {
runTest("compiler/testData/codegen/box/fir/falsePositiveBoundSmartcast.kt");
}
@Test
@TestMetadata("nestedClassTypeParameterDeserialization.kt")
public void testNestedClassTypeParameterDeserialization() throws Exception {
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
}
}
@Nested
@@ -13640,6 +13640,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
public void testFalsePositiveBoundSmartcast() throws Exception {
runTest("compiler/testData/codegen/box/fir/falsePositiveBoundSmartcast.kt");
}
@Test
@TestMetadata("nestedClassTypeParameterDeserialization.kt")
public void testNestedClassTypeParameterDeserialization() throws Exception {
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
}
}
@Nested