555d8eeb25
For explanation, see nestedPartiallyResolvedCallsSimple.k
The problem was caused by "select" variable is being leaked to the
inference session of delegate while it should not happen because
it doesn't belong to the common system of `KotlinVal { ..` call,
as we complete it with fixing `E` variable during completion
for `A(select(null, fun(): Int { return 1 }))`.
The root of the problem is that we were adding all the partial
nested calls to the session, while in fact we only need there
the top-level one.
^KT-57543 Fixed
17 lines
325 B
Kotlin
Vendored
17 lines
325 B
Kotlin
Vendored
// FIR_IDENTICAL
|
|
// ISSUE: KT-57543
|
|
|
|
class KotlinVal<T>(initializer: () -> T) {
|
|
operator fun getValue(instance: Any?, metadata: Any?): T = TODO()
|
|
}
|
|
|
|
class A(
|
|
myType: (() -> Int)?
|
|
) {
|
|
val arguments: A by KotlinVal {
|
|
A(select(null, fun(): Int { return 1 }))
|
|
}
|
|
}
|
|
|
|
fun <E> select(e: E, f: E): E = TODO()
|