FIR: Properly support raw types in type parameter upper bounds

^KT-49345 Fixed
This commit is contained in:
Denis.Zharkov
2022-10-14 18:18:39 +02:00
committed by Space Team
parent 73cffa315d
commit 7b15b28ee2
8 changed files with 75 additions and 34 deletions
@@ -1,18 +0,0 @@
// 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>) {}
+2 -1
View File
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// SKIP_TXT
// FILE: StubElement.java
@@ -12,7 +13,7 @@ public class IStubFileElementType<X extends StubElement> {
// 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<*>?>
bar(i.getFoo())
}
fun bar(w: StubElement<CharSequence>) {}