Fixed inference in a simple case.

Try number lower bounds before upper bounds when computing a value.
This commit is contained in:
svtk
2013-11-19 23:03:52 +04:00
parent 9d3a7804cc
commit 1a34dffb1f
4 changed files with 50 additions and 29 deletions
@@ -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 }
}