Files
kotlin-fork/compiler/testData/codegen/box/ieee754/whenNullableSmartCast10.kt
T
Zalim Bashorov 3f0b31dc23 Speed up JS IR BE tests compiling the common parts (runtime + test common utils) once (on demand) and sharing the result between tests
It's a temporary hack until we implement IR based library format.
It relies on the fact that currently, IR BE generates stable (enough) names.​
2018-07-13 23:42:41 +03:00

29 lines
634 B
Kotlin
Vendored

// LANGUAGE_VERSION: 1.0
fun box(): String {
val nullValue: Any? = null
val nullDouble: Double? = null
val minusZero: Any = -0.0
if (nullValue is Double?) {
when (nullValue) {
-0.0 -> {
return "fail 1"
}
nullDouble -> {}
else -> return "fail 2"
}
if (minusZero is Double) {
when (nullValue) {
minusZero -> {
return "fail 3"
}
nullDouble -> {
}
else -> return "fail 4"
}
}
}
return "OK"
}