[FIR2IR] Properly handle intersection types in interface delegation

The changes to the irText test data result in the fact that we
now unconditionally unwrap substitution overrides of delegation targets
whereas before we built an unsubstituted scope of the type we delegate
to. If we delegate to a class A : B<C>, the unsubstituted scope of
A can still contain substitution overrides for inherited generic methods
from B<T> that we didn't unwrap before but do unwrap now.

#KT-57899 Fixed
This commit is contained in:
Kirill Rakhman
2023-04-12 14:54:53 +02:00
committed by Space Team
parent cda7dc4a3a
commit e80b4c530d
33 changed files with 793 additions and 67 deletions
@@ -13164,6 +13164,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
runTest("compiler/testData/codegen/box/delegation/delegationDifferentModule.kt");
}
@Test
@TestMetadata("delegationToIntersectionType.kt")
public void testDelegationToIntersectionType() throws Exception {
runTest("compiler/testData/codegen/box/delegation/delegationToIntersectionType.kt");
}
@Test
@TestMetadata("delegationWithPrivateConstructor.kt")
public void testDelegationWithPrivateConstructor() throws Exception {
@@ -13200,6 +13206,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
runTest("compiler/testData/codegen/box/delegation/kt8154.kt");
}
@Test
@TestMetadata("smartCastedDelegation.kt")
public void testSmartCastedDelegation() throws Exception {
runTest("compiler/testData/codegen/box/delegation/smartCastedDelegation.kt");
}
@Test
@TestMetadata("viaTypeAlias.kt")
public void testViaTypeAlias() throws Exception {
@@ -13464,6 +13464,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
runTest("compiler/testData/codegen/box/delegation/delegationDifferentModule.kt");
}
@Test
@TestMetadata("delegationToIntersectionType.kt")
public void testDelegationToIntersectionType() throws Exception {
runTest("compiler/testData/codegen/box/delegation/delegationToIntersectionType.kt");
}
@Test
@TestMetadata("delegationWithPrivateConstructor.kt")
public void testDelegationWithPrivateConstructor() throws Exception {
@@ -13500,6 +13506,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
runTest("compiler/testData/codegen/box/delegation/kt8154.kt");
}
@Test
@TestMetadata("smartCastedDelegation.kt")
public void testSmartCastedDelegation() throws Exception {
runTest("compiler/testData/codegen/box/delegation/smartCastedDelegation.kt");
}
@Test
@TestMetadata("viaTypeAlias.kt")
public void testViaTypeAlias() throws Exception {
@@ -13014,6 +13014,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/delegation/delegationDifferentModule.kt");
}
@Test
@TestMetadata("delegationToIntersectionType.kt")
public void testDelegationToIntersectionType() throws Exception {
runTest("compiler/testData/codegen/box/delegation/delegationToIntersectionType.kt");
}
@Test
@TestMetadata("delegationWithPrivateConstructor.kt")
public void testDelegationWithPrivateConstructor() throws Exception {
@@ -13050,6 +13056,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/delegation/kt8154.kt");
}
@Test
@TestMetadata("smartCastedDelegation.kt")
public void testSmartCastedDelegation() throws Exception {
runTest("compiler/testData/codegen/box/delegation/smartCastedDelegation.kt");
}
@Test
@TestMetadata("viaTypeAlias.kt")
public void testViaTypeAlias() throws Exception {
@@ -13314,6 +13314,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
runTest("compiler/testData/codegen/box/delegation/delegationDifferentModule.kt");
}
@Test
@TestMetadata("delegationToIntersectionType.kt")
public void testDelegationToIntersectionType() throws Exception {
runTest("compiler/testData/codegen/box/delegation/delegationToIntersectionType.kt");
}
@Test
@TestMetadata("delegationWithPrivateConstructor.kt")
public void testDelegationWithPrivateConstructor() throws Exception {
@@ -13350,6 +13356,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
runTest("compiler/testData/codegen/box/delegation/kt8154.kt");
}
@Test
@TestMetadata("smartCastedDelegation.kt")
public void testSmartCastedDelegation() throws Exception {
runTest("compiler/testData/codegen/box/delegation/smartCastedDelegation.kt");
}
@Test
@TestMetadata("viaTypeAlias.kt")
public void testViaTypeAlias() throws Exception {