Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt
T
simon.ogorodnik 34e6649d31 [FIR] Harden check of argument type properly
Before this commit, nullable argument could match not null parameter.
Now we require also correct nullability that breaks some cases
2020-02-03 16:45:18 +03:00

20 lines
451 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
// !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) {
<!INAPPLICABLE_CANDIDATE!>A<!>(x)
<!INAPPLICABLE_CANDIDATE!>A<!><F>(x)
<!INAPPLICABLE_CANDIDATE!>foo1<!>(x)
<!INAPPLICABLE_CANDIDATE!>foo1<!><F>(x)
x.<!INAPPLICABLE_CANDIDATE!>foo2<!>()
x.<!INAPPLICABLE_CANDIDATE!>foo2<!><F>()
}