Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.kt
T
Mikhail Zarechenskiy d2ce73853d Report more specific diagnostic for variable + invoke calls
Do not report same set of diagnostics for variable call if actual
 error was happened with a function candidate. Here the candidate is
 invoke function on DeepRecursiveFunction

 ^KT-40991 Fixed
 ^KT-41491 Fixed
 ^KT-40926 In Progress
2021-01-22 13:57:47 +03:00

15 lines
446 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun Int.invoke(a: Int) {}
fun Int.invoke(a: Int, b: Int) {}
class SomeClass
fun test(identifier: SomeClass, fn: String.() -> Unit) {
<!DEBUG_INFO_MISSING_UNRESOLVED, FUNCTION_EXPECTED!>identifier<!>()
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>identifier<!>(123)
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>identifier<!>(1, 2)
1.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>fn<!>()
}