Godot version
4.0.dev (015dc49)
System information
Linux (Ubuntu 22.04), Vulkan, Radeon RX Vega 64 (eGPU)
Issue description
# base.gd
extends Resource
const A: = preload("res://a.gd")
# extend.gd
extends "base.gd"
static func test(a: A) -> void:
print(A)
The editor will complain with this error in extend.gd: Error at (4, 19): "A" was not found in the current scope..
But removing the typing from test() (static func test(a) -> void:), the following line will print without any issues.
<GDScript#-9223372009658908249>
It's not possible too to declare something like const A: = preload("res://a.gd") inside extend.gd as it will result with this error: The member "A" already exists in parent class res://base.gd.
Extended classes should be able to use constants declared inside the base class the same way it is possible to use them inside that said base class.
Steps to reproduce
- Create a base class
- Create an extend class
- Declare a constant that preloads a class in the base class
- Try to use that constant as a type inside the extend class
Minimal reproduction project
69586.zip
Godot version
4.0.dev (015dc49)
System information
Linux (Ubuntu 22.04), Vulkan, Radeon RX Vega 64 (eGPU)
Issue description
The editor will complain with this error in
extend.gd:Error at (4, 19): "A" was not found in the current scope..But removing the typing from
test()(static func test(a) -> void:), the following line will print without any issues.<GDScript#-9223372009658908249>It's not possible too to declare something like
const A: = preload("res://a.gd")insideextend.gdas it will result with this error:The member "A" already exists in parent class res://base.gd.Extended classes should be able to use constants declared inside the base class the same way it is possible to use them inside that said base class.
Steps to reproduce
Minimal reproduction project
69586.zip