diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-17 20:56:43 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-17 20:56:43 +0100 |
commit | 48e869095e532c17bc771c7772967a09f07e5c1e (patch) | |
tree | 980a529157b5036c898b92e7dc72289505952d49 /modules/gdscript/gdscript_analyzer.cpp | |
parent | 70a0201e6abc2d32a390383a4c928d9f43e7148c (diff) | |
parent | 2fefcf7329287c34ee9c5143ab96a7976d96a33e (diff) | |
download | redot-engine-48e869095e532c17bc771c7772967a09f07e5c1e.tar.gz |
Merge pull request #70055 from adamscott/fix-constant-inner-class
Fix GDScript external inner class constant assignment
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 7d14bcf3c4..3bbe71fb90 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -3148,6 +3148,16 @@ void GDScriptAnalyzer::reduce_identifier_from_base(GDScriptParser::IdentifierNod case GDScriptParser::ClassNode::Member::FUNCTION: p_identifier->set_datatype(make_callable_type(member.function->info)); break; + case GDScriptParser::ClassNode::Member::CLASS: + if (p_base != nullptr && p_base->is_constant) { + Error err = OK; + GDScript *scr = GDScriptCache::get_full_script(base.script_path, err).ptr(); + ERR_FAIL_COND_MSG(err != OK, "Error while getting subscript full script."); + scr = scr->find_class(p_identifier->get_datatype().class_type->fqcn); + p_identifier->reduced_value = scr; + p_identifier->is_constant = true; + } + break; default: break; // Type already set. } |