Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/unsupported/callableReferenceToLocalVariable.fir.kt
T
Kirill Rakhman 2f3293f99e [FIR] Skip redundant INAPPLICABLE_CANDIDATE on call with unresolved callable reference argument
A new resolution diagnostic UnsuccessfulCallableReferenceAtom is
introduced that is used in EagerResolveOfCallableReferences.
No diagnostic is reported on unresolved calls with this diagnostic
because

#KT-59856
2023-07-20 07:29:18 +00:00

23 lines
395 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
fun a() {
val x = 10
foo(::<!UNSUPPORTED!>x<!>)
}
fun foo(a: Any) {}
fun test1(test2: () -> Unit = ::test2) {} // Resolve to function
private fun test2() {}
fun test3(test4: () -> Unit = ::<!UNSUPPORTED!>test4<!>) {}
fun test5(test6: (test: Test) -> Unit = Test::helper) {
test6(Test())
}
class Test {
fun helper() {}
}