Skip to content
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

GDScript: Fix message when calling non-tool function in tool mode #94511

Merged

Conversation

dalexeev
Copy link
Member

@dalexeev dalexeev commented Jul 18, 2024

Instead of the "Nonexistent function..." error, a more useful message is displayed:

res://addons/BugIsHere/addon_main.gd:15 - Invalid call function 'initialize' in base 'Control (AddonControl)': Attempt to call a method on a placeholder instance. Check if the script has the tool annotation.

@dalexeev dalexeev added this to the 4.3 milestone Jul 18, 2024
@dalexeev dalexeev requested review from a team as code owners July 18, 2024 13:51
@dalexeev dalexeev force-pushed the gds-fix-message-call-non-tool-func branch 2 times, most recently from 49e6f66 to 4b00b09 Compare July 18, 2024 14:02
@AdriaandeJongh
Copy link
Contributor

Why not something along the lines of "Methods without the @tool annotation can't by called by scripts in tool mode."? "Check if" implies less of a fix.

@dalexeev dalexeev modified the milestones: 4.3, 4.4 Jul 24, 2024
@dalexeev dalexeev added the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Jul 24, 2024
@dalexeev dalexeev force-pushed the gds-fix-message-call-non-tool-func branch from 4b00b09 to 2d8f6c1 Compare August 27, 2024 09:30
@akien-mga akien-mga merged commit 627bff7 into godotengine:master Aug 27, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

No cherry-picking for 4.3.x for now as this caused regressions (fixed with #96173 and #96344, but this calls for some caution/more testing in 4.4).

@akien-mga akien-mga removed the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Sep 16, 2024
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.

Improve error message for calling non-tool scripts from tool scripts
4 participants