Fixed inference in a simple case.
Try number lower bounds before upper bounds when computing a value.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
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 }
|
||||
}
|
||||
Reference in New Issue
Block a user