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
-Reproduceable in 4.2.1 and 4.3-dev2, both on Windows and Linux. I believe this has been present since at least 4.1, never tried in 4.0
System information
Godot v4.3.dev2 - Windows 10.0.19045 - Vulkan (Forward+) - integrated Intel(R) HD Graphics 530 (Intel Corporation; 30.0.101.1340) - Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz (4 Threads)
Issue description
If you use type hints to assign a variable say from get_parent() or somewhere other than the class members it won't work
func _process(delta):
var parent : MyCustomClass = get_parent()
var global_obj_of_import : AnotherCustomClass = Globals.a_member
func a_function():
for child in get_children():
var custom_class : MyCustomClass = child
This requires the use of the 'as' keyword. I understand that the code doesn't check for the type and so at runtime it doesn't "know" that the type hint is correct, meaning the variable will be null if it isn't that type. The thing is, when coding, if the code specifies a type hint of a variable, it should show the relevent autocomplete. I should be even be able to swap the type hint to something completely wrong but get the code complete for that typehint.
Steps to reproduce
Create a script that makes use of the 'class_name' keyword
Add some functions or member variables you expect it to have
Assign something to a local variable from get_parent(), get_children() in a loop, or an Autoload using the class_name in the type hint (as described in the issue description)
Tested versions
-Reproduceable in 4.2.1 and 4.3-dev2, both on Windows and Linux. I believe this has been present since at least 4.1, never tried in 4.0
System information
Godot v4.3.dev2 - Windows 10.0.19045 - Vulkan (Forward+) - integrated Intel(R) HD Graphics 530 (Intel Corporation; 30.0.101.1340) - Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz (4 Threads)
Issue description
If you use type hints to assign a variable say from get_parent() or somewhere other than the class members it won't work
This requires the use of the 'as' keyword. I understand that the code doesn't check for the type and so at runtime it doesn't "know" that the type hint is correct, meaning the variable will be null if it isn't that type. The thing is, when coding, if the code specifies a type hint of a variable, it should show the relevent autocomplete. I should be even be able to swap the type hint to something completely wrong but get the code complete for that typehint.
Steps to reproduce
Minimal reproduction project (MRP)
autocomplete.zip
The text was updated successfully, but these errors were encountered: