1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #109433 from KoBeWi/hastension

Add `has_extension()` method to String
This commit is contained in:
Thaddeus Crews
2025-10-31 09:23:30 -05:00
29 changed files with 46 additions and 48 deletions

View File

@@ -492,7 +492,7 @@ Error GDScriptAnalyzer::resolve_class_inheritance(GDScriptParser::ClassNode *p_c
}
} else if (ProjectSettings::get_singleton()->has_autoload(name) && ProjectSettings::get_singleton()->get_autoload(name).is_singleton) {
const ProjectSettings::AutoloadInfo &info = ProjectSettings::get_singleton()->get_autoload(name);
if (info.path.get_extension().to_lower() != GDScriptLanguage::get_singleton()->get_extension()) {
if (!info.path.has_extension(GDScriptLanguage::get_singleton()->get_extension())) {
push_error(vformat(R"(Singleton %s is not a GDScript.)", info.name), id);
return ERR_PARSE_ERROR;
}