[FIR] Don't analyze lambda twice inside delegate inference

This is a workaround for ^KT-54767
This commit is contained in:
Dmitriy Novozhilov
2022-11-02 14:37:48 +02:00
committed by Space Team
parent 7af43176ce
commit 2fd8bf9153
4 changed files with 35 additions and 0 deletions
@@ -0,0 +1,18 @@
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB
// ISSUE: KT-54767
interface A {
fun getCallableNames(): Set<String>
}
class B(val declared: A, val supers: List<A>) {
private val callableNamesCached by lazy(LazyThreadSafetyMode.PUBLICATION) {
buildSet {
addAll(declared.getCallableNames())
supers.flatMapTo(this) { it.getCallableNames() }
}
}
}
fun box() = "OK"