-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inherent type of a slice of a list #551
Comments
We want So in your case, in order to call (One of the reasons lang.array is called lang.array not lang.list is that it treats its first argument as an array.) |
Ack, thank you. |
Description:
The
lang.array:slice
method is defined as follows.The concern is regarding the actual inherent type of the slice created; is it the type representing the exact slice at the point of creation?
So the static type here would have to be an array of
(int|string|boolean)
, but what should be the inherent type of the slice, which in this case would be["ballerina", true]
?Should it be
[string, boolean]
(string|boolean)[]
(string|boolean)[2]
(int|string|boolean)[]
Similarly, for an array, should a slice result in a fixed length list?
The text was updated successfully, but these errors were encountered: