[FIR] Fix flattening of substitution overrides of intersection overrides for subsumed check
#KT-65555 Fixed
This commit is contained in:
committed by
Space Team
parent
3994e3f63a
commit
879cdd5952
+6
@@ -29157,6 +29157,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt13355viaJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65555.kt")
|
||||
public void testKt65555() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt65555.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt9550.kt")
|
||||
public void testKt9550() throws Exception {
|
||||
|
||||
+6
@@ -29157,6 +29157,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt13355viaJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65555.kt")
|
||||
public void testKt65555() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt65555.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt9550.kt")
|
||||
public void testKt9550() throws Exception {
|
||||
|
||||
+6
@@ -26903,6 +26903,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt13355viaJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65555.kt")
|
||||
public void testKt65555() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt65555.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt9550.kt")
|
||||
public void testKt9550() throws Exception {
|
||||
|
||||
+6
@@ -26909,6 +26909,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt13355viaJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65555.kt")
|
||||
public void testKt65555() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt65555.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt9550.kt")
|
||||
public void testKt9550() throws Exception {
|
||||
|
||||
+1
-1
@@ -171,7 +171,7 @@ fun FirCallableSymbol<*>.dispatchReceiverScope(session: FirSession, scopeSession
|
||||
}
|
||||
|
||||
fun MemberWithBaseScope<FirCallableSymbol<*>>.flattenIntersectionsRecursively(): List<MemberWithBaseScope<FirCallableSymbol<*>>> {
|
||||
if (member.origin != FirDeclarationOrigin.IntersectionOverride) return listOf(this)
|
||||
if (member.unwrapSubstitutionOverrides<FirCallableSymbol<*>>().origin != FirDeclarationOrigin.IntersectionOverride) return listOf(this)
|
||||
|
||||
return baseScope.getDirectOverriddenMembersWithBaseScope(member).flatMap { it.flattenIntersectionsRecursively() }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// FIR_IDENTICAL
|
||||
// FULL_JDK
|
||||
// WITH_STDLIB
|
||||
// ISSUE: KT-65555
|
||||
|
||||
interface MyCollection<E> : Collection<E>
|
||||
interface MyList<E> : MyCollection<E>, List<E>
|
||||
interface MyMutableList<E> : MyList<E>, MutableList<E>
|
||||
Generated
+6
@@ -29157,6 +29157,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt13355viaJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65555.kt")
|
||||
public void testKt65555() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/override/clashesOnInheritance/kt65555.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt9550.kt")
|
||||
public void testKt9550() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user