Fix type inference for autoload scenes while they are being loaded #98313
+19
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #77643
Fixes #98270
This is a quick and dirty fix to the obscure bug described in the issues above. It's dirty because it relies on the shaky assumption that if the node of the autoload singleton is retrieved as
null
that means we are in the middle of instantiating that very scene, and because I temporarily store the scene's root node's script path in the value for the autoload, which it is not meant for. So I don't expect this to be merged as-is, just want to kickstart a discussion about possible solutions.How shaky is the assumption described above? Can it be relied upon after all?
If the approach in principle is okay, what would be a better place to temporarily store the script path?