mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 08:31:30 +00:00
22 lines
370 B
Kotlin
Vendored
22 lines
370 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// KJS_WITH_FULL_RUNTIME
|
|
// !LANGUAGE: +NewInference
|
|
// WITH_RUNTIME
|
|
|
|
class Foo
|
|
|
|
class Builder {
|
|
var size: Int = 0
|
|
|
|
fun addFoo(foo: Foo): Builder {
|
|
size++
|
|
return this
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val b = Builder()
|
|
listOf(Foo(), Foo(), Foo()).forEach(b::addFoo)
|
|
return if (b.size == 3) "OK" else "Fail"
|
|
}
|