Ensure the correct functions (with correct params) are being used in

ForLoopsLowering.
This commit is contained in:
Mark Punzalan
2019-11-06 15:54:13 -08:00
committed by max-kammerer
parent 21178a4f1a
commit d0c261c779
9 changed files with 74 additions and 10 deletions
@@ -0,0 +1,21 @@
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
import kotlin.test.*
class MyCharSequence(val s: String) : CharSequence {
fun get(foo: String): Char = TODO("shouldn't be called!")
override val length = s.length
override fun subSequence(startIndex: Int, endIndex: Int) = s.subSequence(startIndex, endIndex)
override fun get(index: Int) = s.get(index)
}
fun box(): String {
val cs = MyCharSequence("1234")
val result = StringBuilder()
for (c in cs) {
result.append(c)
}
assertEquals("1234", result.toString())
return "OK"
}