[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
This commit is contained in:
@@ -7,8 +7,8 @@ fun ObjectWithExtension?.nullableExtensionFun(): String =
|
||||
"Not null"
|
||||
|
||||
fun ObjectWithExtension.extensionFun(): String =
|
||||
if(<!EVALUATED("false")!>this == null<!>)
|
||||
"Null" // unreachable branch, will be optimized by interpreter
|
||||
if(this == null)
|
||||
"Null"
|
||||
else
|
||||
"Not null"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
object Test {
|
||||
fun foo(): String = "foo " + this
|
||||
|
||||
fun bar(): String = "bar $this"
|
||||
fun bar(): String = "<!EVALUATED("bar ")!>bar <!>$this"
|
||||
|
||||
fun baz(): String = "baz " + this.toString()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user