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

Unhelpful RETURN_VALUE_DISCARDED warning on tweening functions #68585

Closed
m-r-hunt opened this issue Nov 13, 2022 · 1 comment
Closed

Unhelpful RETURN_VALUE_DISCARDED warning on tweening functions #68585

m-r-hunt opened this issue Nov 13, 2022 · 1 comment

Comments

@m-r-hunt
Copy link
Contributor

Godot version

4.0 beta 4

System information

Windows 10

Issue description

When using tweening functions, you get a GDScript RETURN_VALUE_DISCARDED warning which is pretty useless. For example I have some code like this:

text_tween = create_tween()
text_tween.tween_property(dialog_text, ^":visible_characters", chars, chars/CHARS_PER_SECOND)

I get a warning on the second line here because tween_property returns a PropertyTweener object that I can use to customise the tween further. However in this case I don't need to do so, and this warning is very useless. There's no hidden bug or issue that could arise from ignoring this return value.

To silence it I have a few options, all of which are kind of clunky:

  • Declare and assign an _unused variable
  • Disable the warning locally with an annotation
  • Disable the warning globally in settings

I think there should be some way to have a return value that is marked as "OK to ignore", and these methods should be marked as such so this problem doesn't arise.

Steps to reproduce

Use tweening methods with warnings turned on.

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Nov 13, 2022

Duplicate of godotengine/godot-proposals#682.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2022
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

3 participants