Files
kotlin/compiler/testData/codegen/bytecodeText/whenStringOptimization/duplicatingItemsSameHashCode.kt
2018-12-21 16:20:45 +01:00

18 lines
329 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
import kotlin.test.assertEquals
fun foo(x : String) : String {
assert("abz]".hashCode() == "aby|".hashCode())
when (x) {
"abz]" -> return "abz"
"ghi" -> return "ghi"
"aby|" -> return "aby"
"abz]" -> return "fail"
}
return "other"
}
// 1 LOOKUPSWITCH