Fix for KT-12582: "VerifyError: Bad local variable type" caused by explicit loop variable type
#KT-12582 Fixed
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
fun box(): String {
|
||||
var result = 0
|
||||
val intRange: IntProgression = 1..3
|
||||
for (i: Int? in intRange) {
|
||||
result = sum(result, i)
|
||||
}
|
||||
return if (result == 6) "OK" else "fail: $result"
|
||||
}
|
||||
|
||||
fun sum(i: Int, z: Int?): Int {
|
||||
return i + z!!
|
||||
}
|
||||
Reference in New Issue
Block a user