You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
GDScript: Fix typed array with custom classes
This commit is contained in:
@@ -470,6 +470,7 @@ GDScriptParser::DataType GDScriptAnalyzer::resolve_datatype(GDScriptParser::Type
|
|||||||
GDScriptParser::DataType container_type = resolve_datatype(p_type->container_type);
|
GDScriptParser::DataType container_type = resolve_datatype(p_type->container_type);
|
||||||
|
|
||||||
if (container_type.kind != GDScriptParser::DataType::VARIANT) {
|
if (container_type.kind != GDScriptParser::DataType::VARIANT) {
|
||||||
|
container_type.is_meta_type = false;
|
||||||
result.set_container_element_type(container_type);
|
result.set_container_element_type(container_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
class Inner:
|
||||||
|
var prop = "Inner"
|
||||||
|
|
||||||
|
|
||||||
|
var array: Array[Inner] = [Inner.new()]
|
||||||
|
|
||||||
|
|
||||||
|
func test():
|
||||||
|
var element: Inner = array[0]
|
||||||
|
print(element.prop)
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
GDTEST_OK
|
||||||
|
Inner
|
||||||
Reference in New Issue
Block a user