Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/reportingImprovements/kt42620.kt
T
Victor Petukhov 0dde5ddd7e Fail calls constraints of which contain uninferred type parameter
^KT-44055 Fixed

It's possible only if there is a callable reference among subcalls which go though the old type inference (and the error for uninferred type parameter wasn't reported)
2020-12-25 11:53:16 +03:00

16 lines
778 B
Kotlin
Vendored

// SKIP_TXT
class Foo
fun main1() = when {
else -> <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, TYPE_MISMATCH!>Foo::plus<!>
}
fun main2() = if (true) <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo::<!UNRESOLVED_REFERENCE!>minus<!><!> else <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo::<!UNRESOLVED_REFERENCE!>times<!><!>
fun main3() = if (true) { Foo::<!UNRESOLVED_REFERENCE!>minus<!> } else { Foo::<!UNRESOLVED_REFERENCE!>times<!> }
fun main4() = try { Foo::<!UNRESOLVED_REFERENCE!>minus<!> } finally { <!UNUSED_EXPRESSION!>Foo::<!UNRESOLVED_REFERENCE!>times<!><!> }
fun main5() = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo::<!UNRESOLVED_REFERENCE!>minus<!><!> ?: <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo::<!UNRESOLVED_REFERENCE!>times<!><!>