Provide asIterable also for CharSequences, Maps and Iterables.

KT-10152 Fixed
This commit is contained in:
Ilya Gorbunov
2015-11-29 05:04:31 +03:00
parent 45db5db7e8
commit f596d9ac23
8 changed files with 145 additions and 103 deletions
@@ -23,18 +23,6 @@ fun arrays(): List<GenericFunction> {
}
}
templates add f("asIterable()") {
only(ArraysOfObjects, ArraysOfPrimitives)
doc { "Returns the Iterable that wraps the original array." }
returns("Iterable<T>")
body {
"""
return object : Iterable<T> {
override fun iterator(): Iterator<T> = this@asIterable.iterator()
}
"""
}
}
templates add pval("lastIndex") {
only(ArraysOfObjects, ArraysOfPrimitives)