FIR: Fix callable references resolution when they're being returned from lambdas

This commit is contained in:
Denis.Zharkov
2021-01-13 21:28:23 +03:00
parent 0e368cc237
commit ad30c6c380
7 changed files with 19 additions and 56 deletions
@@ -1,43 +0,0 @@
// SKIP_TXT
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !LANGUAGE: +NewInference
interface Inv<T>
fun <E> Inv<E>.foo(
handler: () -> ((command: E) -> Unit)
) {}
fun bar(x: Int) {}
fun bar(x: String) {}
fun bar1(arg: Int) {}
fun foo1(f: () -> (Int) -> Unit) = ""
fun main(x: Inv<Int>) {
x.foo<Int> {
if (x.hashCode() == 0) return@foo <!UNRESOLVED_REFERENCE!>::bar<!>
::bar
}
x.foo {
if (x.hashCode() == 0) return@foo <!UNRESOLVED_REFERENCE!>::bar<!>
::bar
}
foo1 {
::bar1
}
foo1 {
return@foo1 ::bar1
}
foo1 {
if (x.hashCode() == 0) return@foo1 ::bar
::bar
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// SKIP_TXT
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !LANGUAGE: +NewInference