Skip to content

Fix UID support for script extends paths #107922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

4d49
Copy link
Contributor

@4d49 4d49 commented Jun 24, 2025

Closes #103479. Now when a string literal is used after extends, it passes through ResourceUID::ensure_path() which:

  1. Automatically converts UID strings (uid://...) to their mapped resource paths
  2. Maintains compatibility with traditional path strings

The error handling was improved to only set extends_path for valid string literals, rejecting non-string types with appropriate error messages. This maintains type safety while expanding functionality. But I'm not sure about that...

While this PR fixes the issue by enabling UID support for script inheritance paths, I'm not entirely confident in my implementation approach. Given my past experience where I accidentally broke the engine's script debugging mode... I'd appreciate if maintainers could pay extra attention during review.

@4d49 4d49 requested a review from a team as a code owner June 24, 2025 05:14
@dalexeev dalexeev added this to the 4.5 milestone Jun 24, 2025
@vnen
Copy link
Member

vnen commented Jun 27, 2025

IMO this should be resolved in the analyzer. The parser only needs to care that it has a valid syntax, which it already does.

In the analyzer, the resolve_class_inheritance() method is the place where this actually gets sorted out figuring out where the path leads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid extend gdscript using the UID
3 participants