FIR: enhance Java type parameter bounds
This also fixes handling of self-recursive types.
TODO: fix jspecify/{strict,warn}Mode/Captured.fir.kt
This commit is contained in:
compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/classTypeParameterBound.fir.kt
Vendored
+4
-4
@@ -13,13 +13,13 @@ public class ClassTypeParameterBound <T extends @NotNull String> {
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun main(x: ClassTypeParameterBound<String?>, y: ClassTypeParameterBound<String>, a: String?, b: String) {
|
||||
val x2 = ClassTypeParameterBound<String?>()
|
||||
fun main(x: ClassTypeParameterBound<<!UPPER_BOUND_VIOLATED!>String?<!>>, y: ClassTypeParameterBound<String>, a: String?, b: String) {
|
||||
val x2 = ClassTypeParameterBound<<!UPPER_BOUND_VIOLATED!>String?<!>>()
|
||||
val y2 = ClassTypeParameterBound<String>()
|
||||
|
||||
val x3 = ClassTypeParameterBound(a)
|
||||
val x3 = ClassTypeParameterBound(<!ARGUMENT_TYPE_MISMATCH!>a<!>)
|
||||
val y3 = ClassTypeParameterBound(b)
|
||||
|
||||
val x4: ClassTypeParameterBound<String?> = ClassTypeParameterBound()
|
||||
val x4: ClassTypeParameterBound<<!UPPER_BOUND_VIOLATED!>String?<!>> = <!TYPE_MISMATCH!>ClassTypeParameterBound()<!>
|
||||
val y4: ClassTypeParameterBound<String> = ClassTypeParameterBound()
|
||||
}
|
||||
|
||||
+4
-4
@@ -13,13 +13,13 @@ public class ClassTypeParameterBoundWithWarnings <T extends @NotNull String> {
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun main(x: ClassTypeParameterBoundWithWarnings<String?>, y: ClassTypeParameterBoundWithWarnings<String>, a: String?, b: String) {
|
||||
val x2 = ClassTypeParameterBoundWithWarnings<String?>()
|
||||
fun main(x: ClassTypeParameterBoundWithWarnings<<!UPPER_BOUND_VIOLATED!>String?<!>>, y: ClassTypeParameterBoundWithWarnings<String>, a: String?, b: String) {
|
||||
val x2 = ClassTypeParameterBoundWithWarnings<<!UPPER_BOUND_VIOLATED!>String?<!>>()
|
||||
val y2 = ClassTypeParameterBoundWithWarnings<String>()
|
||||
|
||||
val x3 = ClassTypeParameterBoundWithWarnings(a)
|
||||
val x3 = ClassTypeParameterBoundWithWarnings(<!ARGUMENT_TYPE_MISMATCH!>a<!>)
|
||||
val y3 = ClassTypeParameterBoundWithWarnings(b)
|
||||
|
||||
val x4: ClassTypeParameterBoundWithWarnings<String?> = ClassTypeParameterBoundWithWarnings()
|
||||
val x4: ClassTypeParameterBoundWithWarnings<<!UPPER_BOUND_VIOLATED!>String?<!>> = <!TYPE_MISMATCH!>ClassTypeParameterBoundWithWarnings()<!>
|
||||
val y4: ClassTypeParameterBoundWithWarnings<String> = ClassTypeParameterBoundWithWarnings()
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,5 +10,5 @@ public interface MapLike<@org.jetbrains.annotations.NotNull K> {
|
||||
|
||||
// FILE: main.kt
|
||||
fun test2(map : MapLike<Int>, x2: Int?) {
|
||||
map.put(x2)
|
||||
map.put(<!ARGUMENT_TYPE_MISMATCH!>x2<!>)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user