ForLoopsLowering: Handle Iterable.withIndex() where the type is a

bounded type parameter.

TODO: Handle Sequences by extending DefaultIterableHandler.
This commit is contained in:
Mark Punzalan
2019-11-26 23:19:00 -08:00
committed by max-kammerer
parent e8252ea874
commit 1a2e09e6a5
20 changed files with 231 additions and 12 deletions

View File

@@ -0,0 +1,16 @@
fun <T : Iterable<*>> test(iterable: T): String {
val s = StringBuilder()
for ((index, x) in iterable.withIndex()) {
s.append("$index:$x;")
}
return s.toString()
}
// 0 withIndex
// 1 iterator
// 1 hasNext
// 1 next
// 0 component1
// 0 component2