Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

19 lines
543 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
class A<T : CharSequence>(x: T)
fun <E : CharSequence> foo1(x: E) {}
fun <E : CharSequence> E.foo2() {}
fun <F : String?> bar(x: F) {
<!TYPE_INFERENCE_UPPER_BOUND_VIOLATED{OI}!>A<!>(<!TYPE_MISMATCH{NI}!>x<!>)
A<<!UPPER_BOUND_VIOLATED!>F<!>>(x)
<!TYPE_INFERENCE_UPPER_BOUND_VIOLATED{OI}!>foo1<!>(<!TYPE_MISMATCH{NI}!>x<!>)
foo1<<!UPPER_BOUND_VIOLATED!>F<!>>(x)
x<!UNSAFE_CALL{NI}!>.<!><!TYPE_INFERENCE_UPPER_BOUND_VIOLATED{OI}!>foo2<!>()
x.foo2<<!UPPER_BOUND_VIOLATED!>F<!>>()
}