-
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
Readonly type that allows immutable structural values #465
Labels
enhancement
Enhancement to language design
implementation/done
Implementation Done
lang
Relates to the Ballerina language specification
Milestone
Comments
jclark
added
enhancement
Enhancement to language design
lang
Relates to the Ballerina language specification
labels
Mar 25, 2020
jclark
added a commit
that referenced
this issue
Mar 27, 2020
Still need to rewrite explanation of immutability for XML and structures. |
Operations that used SameShape need to ignore read-only aspect. |
jclark
added a commit
that referenced
this issue
Apr 1, 2020
We will leave things related to contextually expected type to #392 |
jclark
added
status/pending
Design is agreed and waiting to be added
and removed
status/inprogress
Fixes are in the process of being added
labels
May 12, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
Enhancement to language design
implementation/done
Implementation Done
lang
Relates to the Ballerina language specification
In this issue, meaning of bare
readonly
type is extended from #462 to allow structural values that were constructed as readonly.This means that readonly becomes a non-primary aspect of shape.
Contextually expected type can include readonly. Constructors will construct readonly values when contextually expected type is readonly. Contextually expected type of initializer of readonly field will be intersection of readonly and the type.
Static type of reference to const is subtype of
readonly
.Cast
<readonly>E
thus has the effect on structures of checking that they are readonly. Static type of<readonly>E
will be readonly.The text was updated successfully, but these errors were encountered: