From 2ba4ee91980511126f5c294a3423121a6ed7a7db Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 26 May 2021 09:23:17 -0300 Subject: [PATCH 1/5] GDScript: Fix inner classes and preloaded scripts as types --- modules/gdscript/gdscript_analyzer.cpp | 29 +++++++++++++++++++ .../analyzer/features/gdscript_to_preload.gd | 5 ++++ .../analyzer/features/gdscript_to_preload.out | 1 + .../features/inner_class_as_return_type.gd | 11 +++++++ .../features/inner_class_as_return_type.out | 2 ++ .../features/use_preload_script_as_type.gd | 5 ++++ .../features/use_preload_script_as_type.out | 2 ++ 7 files changed, 55 insertions(+) create mode 100644 modules/gdscript/tests/scripts/analyzer/features/gdscript_to_preload.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/features/gdscript_to_preload.out create mode 100644 modules/gdscript/tests/scripts/analyzer/features/inner_class_as_return_type.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/features/inner_class_as_return_type.out create mode 100644 modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.out diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index e925350ba33..d6a2c35ae86 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -432,8 +432,28 @@ GDScriptParser::DataType GDScriptAnalyzer::resolve_datatype(GDScriptParser::Type case GDScriptParser::ClassNode::Member::CONSTANT: if (member.constant->get_datatype().is_meta_type) { result = member.constant->get_datatype(); + result.is_meta_type = false; found = true; break; + } else if (Ref