Pulling GDScript changes that introduce a new class_name
results in errors
#92054
Labels
Milestone
class_name
results in errors
#92054
Tested versions
Reproducible in: 4.3.dev [bd2300d]
System information
Windows 11 (10.0.22631)
Issue description
This is tangentially related to #75388, except this issue does not necessarily need to involve autoloads or plugins.
When you're doing something like pulling in changes to your project from another Git repository, and those changes contain a new GDScript class with a
class_name
, which is then used in another GDScript file (existing or otherwise) you will be met with errors like this:If you then reload the current project, you'll find that everything parses just fine.
The reason for this seems quite simple. Scripts are loaded and fully parsed as part of
EditorFileSystem::_update_scan_actions
, and the updating of the globalclass_name
cache happens as part ofEditorFileSystem::_update_pending_script_classes
, which happens after_update_scan_actions
, as seen here.So the global
class_name
cache would presumably need to be updated before scripts are fully parsed somehow.Steps to reproduce
git checkout b64a4b4dd
.(To go back to the initial commit, do
git checkout f4f9e9d17
.)Minimal reproduction project (MRP)
ClassNamePullErrors.zip
The text was updated successfully, but these errors were encountered: