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

21 lines
451 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
fun test(ss: List<String?>) {
val shortStrings = hashSetOf<String>()
val longStrings = hashSetOf<String>()
for (s in ss) {
s?.let {
if (s.length < 4) {
shortStrings.add(s)
}
else {
longStrings.add(s)
}
}
}
}
// 2 POP
// 0 INVOKESTATIC java/lang/Boolean\.valueOf
// 0 CHECKCAST java/lang/Boolean
// 0 ACONST_NULL