godot
godot copied to clipboard
GDScript 2.0: Condition `ret.type != BOOL` is true. Returning: `false` during parsing in 4.0.alpha12 and later
Godot version
Since 4.0 alpha 12
System information
Windows 10, 64-bit
Issue description
When writing some code to initialize a variable based on the value of a key in a dict, the GDScript parser reports some errors like below:
Godot Engine v4.0.alpha12.official.2c11e6d9e - https://godotengine.org
Vulkan API 1.2.0 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1660
...
ERROR: Parser bug (please report): tried to assign unset node without an identifier.
at: resolve_class_interface (modules/gdscript/gdscript_analyzer.cpp:656)
ERROR: Condition "ret.type != BOOL" is true. Returning: false
at: in (core/variant/variant_op.cpp:974)
Steps to reproduce
- Create a new empty project and open it.
- Create a new script in the project.
- In the GDScript editor, paste in the following code:
extends Node
var test_arr = [
{"a": 1}
]
var test_val = test_arr[0]
- Type a
.
at the end. NoticeERROR: Parser bug (please report): tried to assign unset node without an identifier.
has been logged to the console. - Type a letter at the end, after the
.
. NoticeERROR: Condition "ret.type != BOOL" is true. Returning: false
has been logged to the console.
Minimal reproduction project
Just some additional information:
I can confirm that the error ERROR: Condition "ret.type != BOOL" is true. Returning: false
doesn't occur on 4.0 alpha 11, so it has to have been introduced in alpha 12.
ERROR: Parser bug (please report): tried to assign unset node without an identifier.
however did exist since at least alpha 5.
Tested on POP_OS 22.04.
Condition "ret.type != BOOL" is true. Returning: false
still happening on Godot 4.0 beta 2.
It's still happening in 4.0 beta3
I get this error in Godot 4.0 beta 16. It also appears when you hold control and hover over the variant function call after the "."
For example the error pops up when you hold control and hover the cursor over append
some_array[0].append
I believe this is fixed already, the mentioned error message does not even exist anymore (probably became not relevant).