mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 08:31:29 +00:00
20 lines
305 B
Kotlin
Vendored
20 lines
305 B
Kotlin
Vendored
class A
|
|
|
|
class B(val items: Collection<A>)
|
|
|
|
class C {
|
|
fun foo(p: Int) {
|
|
when (p) {
|
|
1 -> arrayListOf<Int>().add(1)
|
|
}
|
|
}
|
|
|
|
fun bar() = B(listOf<A>().map { it })
|
|
}
|
|
|
|
fun box(): String {
|
|
C().foo(1)
|
|
if (C().bar().items.isNotEmpty()) return "fail"
|
|
|
|
return "OK"
|
|
} |