[FIR] Don't drop directly inherited functions from origins for intersection overrides in intersection scope

```
open class Base<T> {
    fun foo(): T = ...
}

class Derived<T> : Base<T> {
    override fun foo(): T = ...
}
```

In intersection scope of type `Base<T> & Other<R>` we should create
  intersection override based on `Base.foo(): T` and `Derived.foo(): R`
  at the same time, despite the fact that `Derived.foo` actually directly
  overrides `Base.foo`

^KT-56722 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-02-23 20:19:20 +02:00
committed by Space Team
parent e0fa1e64b9
commit 8ff4af034a
7 changed files with 71 additions and 1 deletions
@@ -4623,6 +4623,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
public void testNoSmartcastToNullableNothing() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/problems/noSmartcastToNullableNothing.kt");
}
@Test
@TestMetadata("smartcastToStarProjectedSubclass.kt")
public void testSmartcastToStarProjectedSubclass() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/problems/smartcastToStarProjectedSubclass.kt");
}
}
@Nested