Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/resolve/resolveCallableReferencesAfterAllSimpleArguments.kt
T
Mikhail Zarechenskiy ff2ce316e1 [NI] Resolve callable reference eagerly at the end of resolution parts
This way we'll resolve less callable references later as we'll have
 more constraints to clip wrong candidates for callable references
2019-04-05 13:16:58 +03:00

16 lines
390 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface A
interface B
fun fooB(b: B) {}
fun <T> bar(f: (T) -> Unit, e: T) {}
fun <T> baz(e: T, f: (T) -> Unit) {}
fun test(a: A, b: B) {
// Note that diagnostic is always on callable references as they are resolved after simple arguments
baz(a, <!TYPE_MISMATCH!>::fooB<!>)
bar(<!TYPE_MISMATCH!>::fooB<!>, a)
}