Add tests to check that chain is not build in some hard cases
This commit is contained in:
committed by
Yan Zhulanow
parent
6ce6301613
commit
70f4933d5b
@@ -0,0 +1,22 @@
|
||||
import java.util.function.IntPredicate
|
||||
|
||||
private class IntStream {
|
||||
|
||||
fun filter(predicate: IntPredicate): IntStream {
|
||||
return this
|
||||
}
|
||||
|
||||
fun sum(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun of(vararg a: Int): IntStream {
|
||||
return IntStream()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
<caret> val s = IntStream.of(1, 2).filter(IntPredicate { it % 2 == 0 }).sum()
|
||||
}
|
||||
Reference in New Issue
Block a user