Change 2nd type parameter of stream to support unbounded streams #453
Labels
Area/Lang
Relates to the Ballerina language specification
incompatible
Resolving issue may not be backwards compatible
Type/Improvement
Enhancement to language design
Milestone
At the moment, the iterator for
stream<T,E>
is of typeNote the
?
in the return type ofnext
.This issue changes it so that the 2nd type parameter represents the completion type of the iterator, i.e.
stream<T,C>
iswhere C would be a subtype of
error?
.This allows us to represent an unbounded stream as type
stream<T,E>
where E is a subtype of error rather than error?. A function like toArray would then not be allowed on an unbounded stream.This is a change to #406.
The text was updated successfully, but these errors were encountered: