KT-25907: Use proper loop parameter type in for-in-CharSequence

This commit is contained in:
Dmitry Petrov
2018-11-19 10:54:04 +03:00
parent b8086d9093
commit 9082f19c00
7 changed files with 39 additions and 2 deletions
@@ -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"
}