-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Check if any global script class is shadowed by a variable #80587
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me! Make sure to use keywords that github understands, like directly say Fixes #<pr-number>
, which will autolink it :)
I haven't tested, just guessing. Can you get a false positive warning when reloading the script in the editor if the class name is already in the global script cache? |
Oh, good point. Let me try. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get the warning to fire when it shouldn't. This is an easy one to revert should problems crop up, so I'd say I still want to merge!
However, I'd actually like to see improved error handling, like so:
- The current warning should explicitly say it's a
native
class, because I think whatClassDB
contains? - We should add another case for the GDScript/scriptserver warning, which should also actually expose what file the class is defined in using
ScriptServer::get_global_class_path(class_name)
. That way we easily know where the conflict is coming from!
520ef83
to
c2f1ddb
Compare
Also, I notice you have quite a few PRs but often say related to instead of fixes/closes in them - feel free to edit those so that GH actually links the issues! And you'd be very welcome in the Godot contributors chat if you wanted to discuss stuff with other godot devs! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small change more so the code is consistent, then I think it's good to merge :)
c2f1ddb
to
1da6c93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!!! :)
1da6c93
to
ceda137
Compare
Thanks! |
Related to #80003