Files
kotlin/compiler/testData/codegen/box/increment/augmentedAssignmentWithComplexRhs.kt
Roman Artemev c62e4b4fcf [JS IR BE] Support coroutines
* Move FinallyBlockLowering to common part
* Fix catching of dynamic exception
* Fix bridges for suspend functions
* Disable explicit cast to Unit
* Run lowering per module
* Update some test data
2018-08-08 18:33:39 +03:00

35 lines
578 B
Kotlin
Vendored

// WITH_RUNTIME
import kotlin.test.*
var log = ""
var result = 20
var doubleResult = 40.0
fun <T> id(value: T) = value
fun box(): String {
result += if (id("true") == "true") {
result += 10
log += "true chosen;"
3
}
else {
4
}
assertEquals(23, result)
doubleResult += if (id("true") == "true") {
doubleResult += 100
log += "true chosen;"
2
}
else {
5
}
assertEquals(42, (doubleResult + 0.1).toInt())
assertEquals("true chosen;true chosen;", log)
return "OK"
}