More precise diagnostics of smart cast impossible #KT-7240 Fixed

This commit is contained in:
Mikhail Glukhikh
2015-11-02 17:56:31 +03:00
parent 16a8e8f6f0
commit 41ebfd025e
31 changed files with 94 additions and 73 deletions
@@ -8,7 +8,7 @@ fun IntArray.forEachIndexed( op: (i: Int, value: Int) -> Unit) {
fun max(a: IntArray): Int? {
var maxI: Int? = null
a.forEachIndexed { i, value ->
if (maxI == null || value >= a[<!TYPE_MISMATCH!>maxI<!>])
if (maxI == null || value >= a[<!SMARTCAST_IMPOSSIBLE!>maxI<!>])
maxI = i
}
return maxI