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

The unused class variable warning appears even if variable used through autoload #22206

Closed
Chaosus opened this issue Sep 18, 2018 · 5 comments
Closed

Comments

@Chaosus
Copy link
Member

Chaosus commented Sep 18, 2018

Godot version:
3.1

Issue description:
I think its not correct to warn user if autoload variable used by other scripts

image

Minimal reproduction project:
WarningBug.zip

@Chaosus Chaosus added this to the 3.1 milestone Sep 18, 2018
@Chaosus Chaosus changed the title The unused variable warning appears even if variable used through autoload The unused class variable warning appears even if variable used through autoload Sep 18, 2018
@vnen
Copy link
Member

vnen commented Sep 18, 2018

This is not a bug. The warning is about "not used in the script". Usage in other scripts are not considered.

@Chaosus
Copy link
Member Author

Chaosus commented Sep 18, 2018

So I need to supress that warning in every autoload ?

@vnen
Copy link
Member

vnen commented Sep 18, 2018

So I need to supress that warning in every autoload ?

Yes, or disable the "Unused class variable" warning.

@Chaosus
Copy link
Member Author

Chaosus commented Sep 18, 2018

Ok.. thanks

@vnen
Copy link
Member

vnen commented Sep 18, 2018

To clarify, there's no way to know if a class variable is used in other scripts, unless we scan every script in the project, which is inefficient. That's one reason I opened #19811.

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

No branches or pull requests

2 participants