Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/nullableArgumentForDnn.kt
T
Denis.Zharkov 0d070f8ba9 K2: Fix processing inference lower bound NullableType <: T & Any
Previously, it was led to plainly adding NullableType <: T constraint
which silently led to successful call completion.
What is suggested is just marking such initial constraint
as unsuccessful.

In K1, the error was reported just via additional type checking
mechanism being run after call completion.

^KT-58665 Fixed
2023-06-07 09:42:55 +00:00

9 lines
169 B
Kotlin
Vendored

// ISSUE: KT-58665
fun <R, T : Any> use(x: String?, r: R, t: T) {
foo(<!TYPE_MISMATCH!>x<!>)
foo(<!TYPE_MISMATCH!>r<!>)
foo(t)
}
fun <W> foo(x: W & Any) {}