IR: create shared variables for val-variables when needed
This is possible when a lambda's contract guarantees initialization of a variable.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: JVM_IR, NATIVE, JS_IR
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@@ -18,4 +18,4 @@ fun box(): String {
|
||||
x = 1L
|
||||
}
|
||||
return if (x != 1L) "FAIL" else "OK"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user