Use receivers from candidate as a fallback during completion of callable references

^KT-45083 Fixed
This commit is contained in:
Victor Petukhov
2021-06-03 17:03:58 +03:00
committed by TeamCityServer
parent fe8f7cfcae
commit 750f327878
2 changed files with 29 additions and 5 deletions
@@ -0,0 +1,19 @@
// WITH_RUNTIME
// DONT_TARGET_EXACT_BACKEND: WASM
import kotlin.experimental.ExperimentalTypeInference
object Hello {
val hello = "hello"
}
@OptIn(ExperimentalTypeInference::class)
fun <E> buildList0(@BuilderInference builder: MutableList<E>.() -> Unit): List<E> = mutableListOf<E>().apply { builder() }
val numbers = buildList0 {
add(Hello.let { it::hello }.get())
}
fun box(): String {
numbers
return "OK"
}