JVM KT-47365 add box test

This commit is contained in:
Dmitry Petrov
2021-06-21 15:54:40 +03:00
committed by teamcityserver
parent 7535f142c0
commit c26d71c4ef
9 changed files with 63 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
// WITH_RUNTIME
enum class EType {
A
}
class Wrapper(var t: EType?)
fun box(): String {
val l = listOf(Wrapper(EType.A), Wrapper(null))
val ll = l.map {
when (it.t) {
EType.A -> "O"
null -> "K"
}
}
return ll[0] + ll[1]
}