Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/regressions/kt1029.kt
T
2012-07-20 19:34:52 +04:00

16 lines
450 B
Kotlin

//KT-1029 Wrong type inference
package i
public fun<T> from(<!UNUSED_PARAMETER!>yielder<!>: ()->Iterable<T>) : Iterable<T> {
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
public fun<T> Iterable<T>.where(<!UNUSED_PARAMETER!>predicate<!> : (T)->Boolean) : ()->Iterable<T> {
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun a() {
val x = 0..200
val odd = from (x where {it%2==0}) // I believe it should infer here
odd : Iterable<Int>
}