-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 Freed Object
booleanization
#93885
Core: Fix Freed Object
booleanization
#93885
Conversation
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.
Preemptively approving of this because this is actually how most people assume it works, on Discord. Even not-so-savvy users can agree this makes sense.
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.
What a one-liner.
Note that #93896 would have to be changed if this is merged beforehand. The boolean note is still important for current/prior versions so I'm a bit baffled it wasn't merged sooner, but I digress. |
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 fix makes sense in the stated scope of just making the current behavior consistent.
For the records,true if not value else false
gives the expected false
on a freed object, because that goes through OperatorEvaluatorNotObject
, which uses get_validated_object()
. This PR fixes the positive condition that doesn't have an operator to evaluate so the GDScript VM just has to booleanize the Variant
.
Thanks! |
Sorry to be a pest but can you include |
==
behavior remains unchanged.Variant.Type
" with "1. Intuitive".null == freed
ornull != freed
. If we choose the first, then falsy freed object makes sense. If the second, then truthy freed object makes more sense. It's probably too risky to make such changes for 4.3 at this point.Test project: null-vs-freed.zip