FIR: Add a test with current behavior on upper bounds with raw types

^KT-49345 Related
This commit is contained in:
Denis.Zharkov
2021-10-21 13:00:06 +03:00
parent 35a7f0f73e
commit 94129dce2e
6 changed files with 60 additions and 0 deletions
@@ -17233,6 +17233,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/j+k/rawOverride.kt");
}
@Test
@TestMetadata("rawUpperBounds.kt")
public void testRawUpperBounds() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/rawUpperBounds.kt");
}
@Test
@TestMetadata("recursionWithJavaSyntheticProperty.kt")
public void testRecursionWithJavaSyntheticProperty() throws Exception {
@@ -17233,6 +17233,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
runTest("compiler/testData/diagnostics/tests/j+k/rawOverride.kt");
}
@Test
@TestMetadata("rawUpperBounds.kt")
public void testRawUpperBounds() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/rawUpperBounds.kt");
}
@Test
@TestMetadata("recursionWithJavaSyntheticProperty.kt")
public void testRecursionWithJavaSyntheticProperty() throws Exception {
@@ -17233,6 +17233,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
runTest("compiler/testData/diagnostics/tests/j+k/rawOverride.kt");
}
@Test
@TestMetadata("rawUpperBounds.kt")
public void testRawUpperBounds() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/rawUpperBounds.kt");
}
@Test
@TestMetadata("recursionWithJavaSyntheticProperty.kt")
public void testRecursionWithJavaSyntheticProperty() throws Exception {
@@ -0,0 +1,18 @@
// SKIP_TXT
// FILE: StubElement.java
public interface StubElement<T extends CharSequence> {}
// FILE: IStubFileElementType.java
import org.jetbrains.annotations.*;
public class IStubFileElementType<X extends StubElement> {
public X getFoo() { return null; }
}
// FILE: main.kt
fun foo(i: IStubFileElementType<*>) {
bar(<!ARGUMENT_TYPE_MISMATCH!>i.getFoo()<!>) // In FIR, `i.getFoo()` has a type ft<StubElement<*>, StubElement<*>?>, while in FE1.0 it's ft<StubElement<CharSequence>, StubElement<*>?>
}
fun bar(w: StubElement<CharSequence>) {}
@@ -0,0 +1,18 @@
// SKIP_TXT
// FILE: StubElement.java
public interface StubElement<T extends CharSequence> {}
// FILE: IStubFileElementType.java
import org.jetbrains.annotations.*;
public class IStubFileElementType<X extends StubElement> {
public X getFoo() { return null; }
}
// FILE: main.kt
fun foo(i: IStubFileElementType<*>) {
bar(i.getFoo()) // In FIR, `i.getFoo()` has a type ft<StubElement<*>, StubElement<*>?>, while in FE1.0 it's ft<StubElement<CharSequence>, StubElement<*>?>
}
fun bar(w: StubElement<CharSequence>) {}
@@ -17239,6 +17239,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/j+k/rawOverride.kt");
}
@Test
@TestMetadata("rawUpperBounds.kt")
public void testRawUpperBounds() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/rawUpperBounds.kt");
}
@Test
@TestMetadata("recursionWithJavaSyntheticProperty.kt")
public void testRecursionWithJavaSyntheticProperty() throws Exception {