Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.kt
T
Denis.Zharkov fe5adab652 K2: Avoid inference diagnostics when arguments are already error typed
For example, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER

It became especially relevant after 0e84bf2053
that together with later commits bring a lot of unnecessary
NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER diagnostic
2023-02-15 08:13:41 +00:00

21 lines
278 B
Kotlin
Vendored

// FIR_IDENTICAL
package a
interface Closeable {
fun close() {}
}
class C : Closeable
public inline fun <T: Closeable, R> T.use(block: (t: T)-> R) : R {
return block(this)
}
fun test() {
C().use {
it.close()
<!UNRESOLVED_REFERENCE!>x<!>
}
}