From 6adf691cc5f0dad61623dfaa029ed8028e7f2943 Mon Sep 17 00:00:00 2001 From: notgoyome Date: Sun, 22 Jun 2025 00:56:56 +0200 Subject: [PATCH] Fix usage of class_name in built-in scripts (no longer allowed) --- modules/gdscript/gdscript_parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 30dc91111c..8fb0e92686 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -996,6 +996,10 @@ void GDScriptParser::parse_class_name() { current_class->fqcn = String(current_class->identifier->name); } + if (script_path.begins_with("res://") && script_path.contains("::")) { + push_error(R"("class_name" isn't allowed in built-in scripts.)"); + } + make_completion_context(COMPLETION_DECLARATION, current_class); if (match(GDScriptTokenizer::Token::EXTENDS)) {