Files
kotlin-fork/compiler/testData/codegen/box/involvesIrInterpreter/kt56215.kt
T
Ivan Kylchik 1ddcdcfc39 [IR] Rewrite logic around object interpretation
Basically we want to allow object interpretation only when we try
to access some const val property.

#KT-57810 Fixed
2023-04-19 13:52:44 +00:00

23 lines
618 B
Kotlin
Vendored

object ObjectWithExtension
fun ObjectWithExtension?.nullableExtensionFun(): String =
if(this == null)
"Null"
else
"Not null"
fun ObjectWithExtension.extensionFun(): String =
if(this == null)
"Null"
else
"Not null"
fun box(): String {
val nullObjectWithExtension: ObjectWithExtension? = null
if ("${nullObjectWithExtension.nullableExtensionFun()}" != "Null") return "Fail 1"
if ("${ObjectWithExtension.nullableExtensionFun()}" != "Not null") return "Fail 2"
if ("${ObjectWithExtension.extensionFun()}" != "Not null") return "Fail 3"
return "OK"
}