1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-20 14:45:44 +00:00

Merge pull request #53720 from vnen/gdscript-typed-array-custom-class

This commit is contained in:
Rémi Verschelde
2021-10-12 16:51:50 +02:00
committed by GitHub
3 changed files with 13 additions and 0 deletions

View File

@@ -470,6 +470,7 @@ GDScriptParser::DataType GDScriptAnalyzer::resolve_datatype(GDScriptParser::Type
GDScriptParser::DataType container_type = resolve_datatype(p_type->container_type);
if (container_type.kind != GDScriptParser::DataType::VARIANT) {
container_type.is_meta_type = false;
result.set_container_element_type(container_type);
}
}

View File

@@ -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)

View File

@@ -0,0 +1,2 @@
GDTEST_OK
Inner