FIR: Add a test with current behavior on upper bounds with raw types
^KT-49345 Related
This commit is contained in:
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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>) {}
|
||||
Generated
+6
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user