Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.kt
T
svtk 1a34dffb1f Fixed inference in a simple case.
Try number lower bounds before upper bounds when computing a value.
2013-11-22 18:58:01 +04:00

6 lines
212 B
Kotlin

public inline fun <T: Any> iterate(initialValue: T, nextFunction: (T) -> T?): Iterator<T> =
throw Exception("$initialValue $nextFunction")
fun foo() {
iterate(3) { n -> if (n > 0) n - 1 else null }
}