[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
@@ -12630,6 +12630,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/delegation/delegationDifferentModule.kt");
}
@TestMetadata("delegationToIntersectionType.kt")
public void testDelegationToIntersectionType() throws Exception {
runTest("compiler/testData/codegen/box/delegation/delegationToIntersectionType.kt");
}
@TestMetadata("delegationToIntersectionType2.kt")
public void testDelegationToIntersectionType2() throws Exception {
runTest("compiler/testData/codegen/box/delegation/delegationToIntersectionType2.kt");
}
@TestMetadata("delegationToMap.kt")
public void testDelegationToMap() throws Exception {
runTest("compiler/testData/codegen/box/delegation/delegationToMap.kt");
@@ -12695,6 +12705,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/delegation/simple.kt");
}
@TestMetadata("smartCastedDelegation.kt")
public void testSmartCastedDelegation() throws Exception {
runTest("compiler/testData/codegen/box/delegation/smartCastedDelegation.kt");
}
@TestMetadata("viaTypeAlias.kt")
public void testViaTypeAlias() throws Exception {
runTest("compiler/testData/codegen/box/delegation/viaTypeAlias.kt");