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
@@ -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>) {}