[Test] Reproduce KT-63738

This commit is contained in:
Dmitriy Novozhilov
2023-11-23 16:16:14 +02:00
committed by Space Team
parent a15057b2ca
commit c34511af37
7 changed files with 61 additions and 0 deletions
@@ -4357,6 +4357,12 @@ public class DiagnosticCompilerTestFirTestdataTestGenerated extends AbstractDiag
runTest("compiler/fir/analysis-tests/testData/resolve/scopes/publicJavaAndPrivateKotlinVar.kt");
}
@Test
@TestMetadata("singleIntersectionOverride.kt")
public void testSingleIntersectionOverride() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/scopes/singleIntersectionOverride.kt");
}
@Test
@TestMetadata("specialFunctionInJava_1.kt")
public void testSpecialFunctionInJava_1() throws Exception {
@@ -4357,6 +4357,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated
runTest("compiler/fir/analysis-tests/testData/resolve/scopes/publicJavaAndPrivateKotlinVar.kt");
}
@Test
@TestMetadata("singleIntersectionOverride.kt")
public void testSingleIntersectionOverride() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/scopes/singleIntersectionOverride.kt");
}
@Test
@TestMetadata("specialFunctionInJava_1.kt")
public void testSpecialFunctionInJava_1() throws Exception {
@@ -0,0 +1,13 @@
FILE: singleIntersectionOverride.kt
public abstract interface A<E1> : R|kotlin/Any| {
public abstract fun foo(): R|E1|
}
public abstract interface B<E2> : R|A<E2>| {
public abstract override fun foo(): R|E2|
}
public abstract interface C<E3> : R|A<E3>| {
}
public abstract interface D<E4> : R|B<E4>|, R|C<E4>| {
}
@@ -0,0 +1,18 @@
// ISSUE: KT-63738
// SCOPE_DUMP: D:foo
interface A<E1> {
fun foo(): E1 // (1)
}
interface B<E2> : A<E2> {
override fun foo(): E2 // (2)
}
interface C<E3> : A<E3> {
// substitution-override fun foo(): E3 // (3)
}
interface D<E4> : B<E4>, C<E4> {
// substitution-override fun foo(): E4 // (4)
}
@@ -0,0 +1,6 @@
D:
[SubstitutionOverride(DeclarationSite)]: public abstract override fun foo(): R|E4| from Use site scope of /D [id: 0]
[Source]: public abstract override fun foo(): R|E2| from Use site scope of /B [id: 1]
[SubstitutionOverride(DeclarationSite)]: public abstract fun foo(): R|E2| from Substitution scope for [Use site scope of /A] for type B<E2> [id: 2]
[Source]: public abstract fun foo(): R|E1| from Use site scope of /A [id: 3]
@@ -4357,6 +4357,12 @@ public class FirLightTreeDiagnosticsTestGenerated extends AbstractFirLightTreeDi
runTest("compiler/fir/analysis-tests/testData/resolve/scopes/publicJavaAndPrivateKotlinVar.kt");
}
@Test
@TestMetadata("singleIntersectionOverride.kt")
public void testSingleIntersectionOverride() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/scopes/singleIntersectionOverride.kt");
}
@Test
@TestMetadata("specialFunctionInJava_1.kt")
public void testSpecialFunctionInJava_1() throws Exception {
@@ -4357,6 +4357,12 @@ public class FirPsiDiagnosticTestGenerated extends AbstractFirPsiDiagnosticTest
runTest("compiler/fir/analysis-tests/testData/resolve/scopes/publicJavaAndPrivateKotlinVar.kt");
}
@Test
@TestMetadata("singleIntersectionOverride.kt")
public void testSingleIntersectionOverride() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/scopes/singleIntersectionOverride.kt");
}
@Test
@TestMetadata("specialFunctionInJava_1.kt")
public void testSpecialFunctionInJava_1() throws Exception {