Fix diagnostic inferred type calculation for null in some cases
#KT-36222 fixed
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun foo(f: () -> String) {}
|
||||
fun <K> select(x: K, y: K): K = x
|
||||
|
||||
fun test() {
|
||||
foo { <!TYPE_MISMATCH!>select("non-null", null)<!> } // inferred String? but String is expected
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user