Files
kotlin/compiler/testData/codegen/bytecodeText/ieee754/whenNullableSmartCast10.kt
Alexander Udalov 0871a3cc4d Use API_VERSION instead of LANGUAGE_VERSION in IEEE754 tests
See `ExpressionCodegen.genEqualsForExpressionsPreferIeee754Arithmetic`:
the behavior here actually depends on the API version, not any language
feature
2018-12-20 12:53:22 +01:00

33 lines
702 B
Kotlin
Vendored

// !API_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"
}
// 4 areEqual \(Ljava/lang/Object;Ljava/lang/Object;\)Z
// 4 areEqual