KT-25907: Use proper loop parameter type in for-in-CharSequence
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun box(): String {
|
||||
val str = "abcd"
|
||||
var r = ""
|
||||
for (c: Char? in str) {
|
||||
r = r + c ?: "?"
|
||||
}
|
||||
if (r != "abcd") throw AssertionError()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user