Files
kotlin-fork/compiler/testData/diagnostics/tests/extensions/contextReceivers/fromKEEP/decimateEveryEvenThird.kt
T
2022-04-06 16:05:37 +00:00

13 lines
269 B
Kotlin
Vendored

// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// WITH_STDLIB
fun List<Int>.decimateEveryEvenThird() = sequence {
var counter = 1
for (e in this@List) {
if (e % 2 == 0 && counter % 3 == 0) {
yield(e)
}
counter += 1
}
}