-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
Unsafe modification of val #1979
Comments
Matches that are based only on capability are supposed to be disallowed - for exactly this reason, you're not supposed to be able to pattern-match on a We need to find out why this safety mechanism is not kicking in - maybe it's because the example is using |
The same thing happens when you replace |
This is coming from the c as C iso The above expression is sugared to try
match c
| let c': C iso! => consume ! c'
else
error
end
end The I don't really see why try
match c
| let c': C iso => consume c'
else
error
end
end |
Not at runtime. Capabilities don't exist at runtime (zero-cost abstraction), so you can't match on them. In this case we need a compile time error stopping you from doing any such matching at all, since matching is done at runtime. |
I see |
@Theodus If you need to do something like this (support Obviously this ticket is still a bug, but once it's fixed you still won't be able to do what you were trying to do, without moving to using type parameters. |
Yeah, I may end up needing to do that. Thanks! |
This program shows a modification to a val Array as if it was an iso reference.
Expected output:
Actual output:
http://pony-playpen.lietar.net/?gist=0f866ad477ff1e3131acc0ee72c9d637
The text was updated successfully, but these errors were encountered: