FIR: cache properties in use-site scope properly

This commit is contained in:
Mikhail Glukhikh
2021-11-02 16:09:50 +03:00
committed by teamcity
parent f2c734fc02
commit 6eaeada1e6
6 changed files with 62 additions and 8 deletions
+27
View File
@@ -0,0 +1,27 @@
// TARGET_BACKEND: JVM_IR
// WITH_RUNTIME
interface PsiOwner {
var psi: String?
}
class PsiOwnerImpl(override var psi: String? = null) : PsiOwner
interface JKElement
interface JKFormattingOwner
abstract class JKTreeElement : JKElement, JKFormattingOwner
abstract class JKDeclaration : JKTreeElement(), PsiOwner by PsiOwnerImpl()
interface JKAnnotationListOwner : JKFormattingOwner
open class JKVariable : JKDeclaration(), JKAnnotationListOwner
class JKEnumConstant : JKVariable()
fun box(): String {
val constant = JKEnumConstant().also { it.psi = "OK" }
return constant.psi!!
}