Is this a bug about type inference?


#1
val shouldBeInt = run {
    var i = 1
    while(true) {
        if (i > 10) return@run i
    }
}

In above code piece, sholeBeInt would be Any type instead of Int


#2

Return an int after the while loop and it will work as expected.

There is an implicit return of Unit.