-
-
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
Revert "Make freed object different than null in comparison operators" #93809
Conversation
This reverts commit 150b50c. As discussed with the GDScript team, this has some implications which aren't fully consensual yet, and which we want to revisit. For now we revert to the 4.2 behavior for the 4.3 release, to avoid breaking user expectations.
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.
It's sad that we reintroduce the bug that if freed
and if not freed
are both true, but I think it's better than introducing freed != null
since we haven't reached a consensus on it.
If we can find a safe way to fix the first bug without changing the second, that would be great. But until then, reverting the change looks reasonable to me.
A shame. I don't understand the consensus? are you trying to obfuscate non-owning references to Can you document more of this issue publicly? |
You can always use |
Ohh, does that work like an |
Here's my take on it, hopefully it can help. I just upgraded my project from 4.2 to 4.3 beta 2 (so, a version with #73896) and it was crashing because I use "!= null" and then ".has_method('queue_free')" to check if I can free a node, but now != null returned false on previously freed objects. Problem is, while I was trying to debug this, I set a breakpoint at the start of my function. And in the editor, while I'm paused just before the first check, I look at the stack and I see that the value of target is indeed <null>. But then if I Step Over, the check is true, and it goes to the second check. This is absolutely not my area of expertise and I'm confused by the difference between null and freed, so the following might be wrong. But to me, it seems like the change was badly implemented. I don't think it makes sense for the editor to show the value of the variable as "null", while at the same time a check of "target != null" returns true. If this is reintroduced, I think it would need to appear correctly in the debugger. |
@DinoMC #73896 has been reverted. In beta 3 the behavior will be the same as in 4.2. However, please note that
See also: |
Yes I know about the reverting, but it seems there's some discussions about maybe reintroducing it later in a better way so I wanted to chime in. |
This reverts commit 150b50c.
As discussed with the GDScript team, this has some implications which aren't fully consensual yet, and which we want to revisit.
For now we revert to the 4.2 behavior for the 4.3 release, to avoid breaking user expectations.