mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
[godot#61386] Fix autoload scenes implicit types
This commit is contained in:
parent
11e1c83309
commit
eb62d241c0
3 changed files with 38 additions and 0 deletions
|
|
@ -3120,6 +3120,18 @@ void GDScriptAnalyzer::reduce_identifier(GDScriptParser::IdentifierNode *p_ident
|
|||
result = type_from_metatype(singl_parser->get_parser()->head->get_datatype());
|
||||
}
|
||||
}
|
||||
} else if (ResourceLoader::get_resource_type(autoload.path) == "PackedScene") {
|
||||
Error err = OK;
|
||||
Ref<GDScript> scr = GDScriptCache::get_packed_scene_script(autoload.path, err);
|
||||
if (err == OK && scr.is_valid()) {
|
||||
Ref<GDScriptParserRef> singl_parser = get_parser_for(scr->get_path());
|
||||
if (singl_parser.is_valid()) {
|
||||
err = singl_parser->raise_status(GDScriptParserRef::INTERFACE_SOLVED);
|
||||
if (err == OK) {
|
||||
result = type_from_metatype(singl_parser->get_parser()->head->get_datatype());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
result.is_constant = true;
|
||||
p_identifier->set_datatype(result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue