-
Notifications
You must be signed in to change notification settings - Fork 23
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
FLIP for removing restricted types #85
Conversation
supporting 100% |
Co-authored-by: Bastian Müller <[email protected]>
Co-authored-by: Bastian Müller <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if keeping this feature is really much of a problem, especially if it makes the migration easier. It is fine in theory though
Keeping the feature definitely isn't a problem per se, but it is now a vestigial part of the language, and given our commitment to supporting the feature set of Stable Cadence, this would really be our last chance to remove it. Given that we're already planning to break every contract anyways, it doesn't seem like that much additional overhead to use this opportunity to remove this while we still can. |
I think this change makes sense, and might even avoid confusion and security issues. Older documentation, tutorials, blog posts, code, etc. might still use restricted references for access control and developers might continue to follow these examples. A combination of entitlements (which "replace" restricted references for access control) and restricted type does not make a lot of sense. @SupunS This change could actually be a solution to the current problem we ran into yesterday: Built-in members are not available on restricted types. |
I am not against the feature, but there needs to be a clear migration path. If a contract stores something like
|
The migration path is pretty clear imo: the example you give with |
nit: I think correct statement is |
Yes, I suppose for the purpose of the migration in this case it would be the |
It just occurred to me that this is also great from a syntactical perspective. The removal of Maybe we could If we could further change the syntax and bring it closer to similar features in other languages? It would be great to remove the overloading of the For example, TypeScript, Swift, and Scala have the syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big 👍 from me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This seems like it's reached consensus, so I am updating the FLIP to accepted and merging this PR. |
Could we maybe still discuss the opportunity for changing the syntax as noted above? |
Perhaps a separate FLIP? Changing the syntax of intersection types does feel like a parallel change to this proposal. |
* add flip * Update cadence/2023-05-05-remove-restricted-types.md Co-authored-by: Bastian Müller <[email protected]> * add info about migration of entitled references * Update cadence/2023-05-05-remove-restricted-types.md Co-authored-by: Bastian Müller <[email protected]> * rename * respond to review * Update cadence/20230505-remove-restricted-types.md --------- Co-authored-by: Bastian Müller <[email protected]>
This proposes to remove restricted types and replace them with InterfaceSet types, as they are no longer necessary after the proposed changes in #54.