-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[Core] Fix property access on read-only Dictionary
#89647
Conversation
1718fae
to
92ffdd9
Compare
if (v) { | ||
*v = p_value; | ||
r_valid = true; |
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 would just silently fail before as it uses the read-only temporary
I'm not familiar with godot/core/variant/dictionary.cpp Lines 82 to 83 in fe01776
|
As explained above, it uses the temporary, it doesn't throw any errors for the operator version and there isn't a distinct It works in core as well, with the |
What we might want to do is add a check to Edit: Writing up an improvement, adding a |
92ffdd9
to
ec29c3e
Compare
Thanks! |
Thank you! |
Read-only dictionaries can be modified with property access, like so:
This seems to be an oversight (and can't find any reports on it), but this makes it aligned with how it works for
const