NI: Fix resolution ambiguity for references returned from lambda
^KT-32267 Fixed
This commit is contained in:
committed by
Mikhail Zarechenskiy
parent
534718794c
commit
caf02806d5
@@ -0,0 +1,43 @@
|
||||
// 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 ::bar
|
||||
|
||||
::bar
|
||||
}
|
||||
|
||||
x.foo {
|
||||
if (x.hashCode() == 0) return@foo ::bar
|
||||
|
||||
::bar
|
||||
}
|
||||
|
||||
foo1 {
|
||||
::bar1
|
||||
}
|
||||
|
||||
foo1 {
|
||||
return@foo1 ::bar1
|
||||
}
|
||||
|
||||
foo1 {
|
||||
if (x.hashCode() == 0) return@foo1 ::bar
|
||||
|
||||
::bar
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user