You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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".
Scope of Change
Two new generic types will be added to the XP type system:
iterable<T>
anditerable<K, V>
, complementing theType::$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 tolang.IterableType(key: null, value: T)
, while the two-component versioniterable<K, V>
will be represented tolang.IterableType(key: K, value: V)
where T, K and V arelang.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/
The text was updated successfully, but these errors were encountered: