-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Collection clone methods should return iso when A is sharable. #1784
Comments
Marking this a medium-priority bug, blocked until #1410 is implemented. |
Changing the name of the ticket, since this applies not only to |
This is currently blocked |
I've written a somewhat lengthy explanation in Zulip about what's going on with the signature of |
It's a quite common pain point in Pony that arrays of
#share
able objects (val
ortag
) cannot beclone
d toiso
orval
, as would be expected (and is the case withString.clone
). This isn't possible because doing so would be unsafe whenA
is not#share
able.This violates principle of least surprise for a lot of our users and we've received three PRs so far of users who were so surprised that they filed a PR to change it (including me, when I was first getting involved with the project). See #279, #1360, #1782.
However, once we have specialization (#1410) we can implement
Array.clone
so that it returnsiso
whenA <: Any #share
, orref
otherwise (as it does now). Doing so would seamlessly resolve the issue for users in the least surprising way.The text was updated successfully, but these errors were encountered: