Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/nullability/useAsValueArgument.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

19 lines
347 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
// !DIAGNOSTICS: -UNUSED_PARAMETER,-UNUSED_VARIABLE
fun <T : CharSequence?> bar1(x: T) {}
fun bar2(x: CharSequence?) {}
fun <T : CharSequence> bar3(x: T) {}
fun bar4(x: String) {}
fun <T : String?> foo(x: T) {
bar1(x)
bar2(x)
<!INAPPLICABLE_CANDIDATE!>bar3<!>(x)
<!INAPPLICABLE_CANDIDATE!>bar4<!>(x)
}