summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gdscript_parser.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 5619729c13..f005f88d2e 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -815,6 +815,16 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
}
if (!dependencies_only) {
+ if (!bfn && ScriptServer::is_global_class(identifier)) {
+ Ref<Script> scr = ResourceLoader::load(ScriptServer::get_global_class_path(identifier));
+ if (scr.is_valid() && scr->is_valid()) {
+ ConstantNode *constant = alloc_node<ConstantNode>();
+ constant->value = scr;
+ expr = constant;
+ bfn = true;
+ }
+ }
+
// Check parents for the constant
if (!bfn && cln->extends_file != StringName()) {
Ref<GDScript> parent = ResourceLoader::load(cln->extends_file);
@@ -7247,6 +7257,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_identifier_type(const DataType
DataType result;
result.has_type = true;
result.script_type = scr;
+ result.is_constant = true;
result.is_meta_type = true;
Ref<GDScript> gds = scr;
if (gds.is_valid()) {
@@ -7297,6 +7308,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_identifier_type(const DataType
if (singleton.is_valid()) {
DataType result;
result.has_type = true;
+ result.is_constant = true;
result.script_type = singleton;
Ref<GDScript> gds = singleton;