Scope of Change
Two new generic types will be added to the XP type system: iterable<T> and iterable<K, V>, complementing the Type::$ITERABLE type union while making it more specific.
Rationale
A function returning iterable does not tell the user what to expect as values for the iteration.
Functionality
The simple one-component type iterable<T> will be mapped to lang.IterableType(key: null, value: T), while the two-component version iterable<K, V> will be represented to lang.IterableType(key: K, value: V) where T, K and V are lang.Type instances.
Security considerations
None
Speed impact
Slight impact of Type::forName() to check for the string "iterable".
Dependencies
XP Compiler support
Related documents
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/