3b9724d20e
The expression needs to be resolved first to determine if there is a receiver that needs to be extracted to a temporary variable. Also, the special case for prefix increment/decrement on local variable without delegates requires resolution to check if the variable is local. ^KT-56771 Fixed ^KT-56659 Fixed
48 lines
922 B
Kotlin
Vendored
48 lines
922 B
Kotlin
Vendored
fun test() {
|
|
var x: Int = 0
|
|
while (less(arg0 = x, arg1 = 0)) { // BLOCK
|
|
}
|
|
while (less(arg0 = x, arg1 = 5)) { // BLOCK
|
|
val <unary>: Int = x
|
|
x = <unary>.inc()
|
|
<unary>
|
|
}
|
|
while (less(arg0 = x, arg1 = 10)) { // BLOCK
|
|
val <unary>: Int = x
|
|
x = <unary>.inc()
|
|
<unary>
|
|
}
|
|
{ // BLOCK
|
|
do// COMPOSITE {
|
|
// } while (less(arg0 = x, arg1 = 0))
|
|
}
|
|
{ // BLOCK
|
|
do{ // BLOCK
|
|
val <unary>: Int = x
|
|
x = <unary>.inc()
|
|
<unary>
|
|
} while (less(arg0 = x, arg1 = 15))
|
|
}
|
|
{ // BLOCK
|
|
do{ // BLOCK
|
|
val <unary>: Int = x
|
|
x = <unary>.inc()
|
|
<unary>
|
|
} while (less(arg0 = x, arg1 = 20))
|
|
}
|
|
}
|
|
|
|
fun testSmartcastInCondition() {
|
|
val a: Any? = null
|
|
when {
|
|
a is Boolean -> { // BLOCK
|
|
while (a /*as Boolean */) { // BLOCK
|
|
}
|
|
{ // BLOCK
|
|
do// COMPOSITE {
|
|
// } while (a /*as Boolean */)
|
|
}
|
|
}
|
|
}
|
|
}
|