-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
GDScript 2.0: Can't use not
operator (!
) with String
, Dictionary
, or Array
unless const
#58579
Comments
not
operator (!
) with String
, Dictionary
, or Array
unless const
not
operator (!
) with String
, Dictionary
, or Array
unless const
In RC 1, all 4 options give the same error ( |
Also all 3 types have a method to explicitly test for emptiness that should be used. I wouldn't call this a regression, it's more of a change for consistency. |
So this is intended behaviour and not a bug? As i'm porting my old Godot 3.5 project to Godot 4, i have tons of |
If this is about consistency, I'm curious why it's allow to test on strings as long as you do not use
To me this seems inconsistent. Godot 4.0 RC 5 |
I also agree it seems inconsistent to allow: var example_dict :Dictionary = {}
if example_dict:
pass But not allow |
Godot version
4.0 alpha 3
System information
Windows 10
Issue description
In
Godot 4
, emptyString
,Array
, andDictionary
values convert totrue
booleans, unlikeGodot 3
.Is this intended?
Also, you can no longer use
not
/!
in front of said values, unless they're saved into aconst
.Steps to reproduce
Minimal reproduction project
Godot4 NOT Operator.zip
The text was updated successfully, but these errors were encountered: