You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GDScript analyzer does not warn about accessing Enum types from an instance.
For example, in a script that extends Node, print(self.ConnectFlags) does not raise a warning from the analyzer, yet produces the runtime error "Invalid get index 'ConnectFlags'". This behavior feels inconsistent with how accessing other global properties work. For example print(self.Object) raises the analyzer warning "The property "Object" is not present on the inferred type". On the other hand accessing an Enum value from an instance, e.g., print(self.CONNECT_DEFERRED) runs without error and prints the correct value.
Steps to reproduce
extendsNodefunc_ready():
print(self.ConnectFlags)
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered:
dalexeev
changed the title
No warning when attempting to access Enum types from instance.
No warning when attempting to access native enum types from instance.
Oct 8, 2024
Tested versions
v4.2.2.stable.official [15073af]
System information
Godot v4.2.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 32.0.15.5612) - Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz (4 Threads)
Issue description
The GDScript analyzer does not warn about accessing Enum types from an instance.
For example, in a script that extends
Node
,print(self.ConnectFlags)
does not raise a warning from the analyzer, yet produces the runtime error "Invalid get index 'ConnectFlags'". This behavior feels inconsistent with how accessing other global properties work. For exampleprint(self.Object)
raises the analyzer warning "The property "Object" is not present on the inferred type". On the other hand accessing an Enum value from an instance, e.g.,print(self.CONNECT_DEFERRED)
runs without error and prints the correct value.Steps to reproduce
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: