Fix cyclic references in GDScript 2.0

This commit is contained in:
Adam Scott committed 2022-11-18 16:41:31 -05:00
1 parent e8f9cd8ac5
commit 5704055d30
20 files changed
+626 -113

No files matched your search

+7 -1
View File
@@ -648,7 +648,13 @@ GDScriptParser::ClassNode *GDScriptParser::parse_class() {
if (consume(GDScriptTokenizer::Token::IDENTIFIER, R"(Expected identifier for the class name after "class".)")) {
n_class->identifier = parse_identifier();
if (n_class->outer) {
n_class->fqcn = n_class->outer->fqcn + "::" + n_class->identifier->name;
String fqcn = n_class->outer->fqcn;
if (fqcn.is_empty()) {
fqcn = script_path;
}
n_class->fqcn = fqcn + "::" + n_class->identifier->name;
} else {
n_class->fqcn = n_class->identifier->name;
}
}