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 warnings fill log with junk warnings… #21034

Closed
Ovnuniarchos opened this issue Aug 15, 2018 · 5 comments
Closed

GDScript warnings fill log with junk warnings… #21034

Ovnuniarchos opened this issue Aug 15, 2018 · 5 comments
Assignees
Milestone

Comments

@Ovnuniarchos
Copy link
Contributor

…discarding other, possibly useful ones, when doing things like:

  • UNUSED_CLASS_VARIABLE (it is used outside the class)
  • UNUSED_SIGNAL (ditto above)
  • RETURN_VALUE_DISCARDED (as in move_and_* methods, I care about the effects of the method, not their return value)
  • UNUSED_ARGUMENT (it's a predefined signal, you forced me to put it)

…and possibly others I haven't encountered yet.

Is there (or planned) a way of letting the compiler know you know what you're doing?

@akien-mga akien-mga added this to the 3.1 milestone Aug 15, 2018
@akien-mga
Copy link
Member

CC @vnen

@vnen
Copy link
Member

vnen commented Aug 15, 2018

Is there (or planned) a way of letting the compiler know you know what you're doing?

Documentation will be updated, but for now see #19993. You can disable warnings in a file, or in a particular instance of the warning with special comments. You can also disable a type of warning globally in the Project Settings.

@aaronfranke
Copy link
Member

aaronfranke commented Aug 21, 2018

Also, RETURN_VALUE_DISCARDED should not be thrown when a method is called on that line. For example, the return value IS indeed used here, but it's just not stored:

get_tree().change_scene("res://whatever")

Adding var a = to the front of it stops the warning from being shown.

@akien-mga
Copy link
Member

@aaronfranke In this case it would complain about the return value of change_scene (Error) being unused, which is true.

@vnen
Copy link
Member

vnen commented Sep 8, 2018

This is solved already, warnings are not printed to output anymore.

@vnen vnen closed this as completed Sep 8, 2018
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

4 participants