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

Add CONNECT_DISCARD_EXTRA connection flag #38289

Closed
wants to merge 1 commit into from

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Apr 28, 2020

Closes godotengine/godot-proposals#762

Basically the flag makes any excess argument discarded, so that "Too many arguments" error doesn't appear. It works, you can test it with this code:

func _ready() -> void:
	$AnimationPlayer.animation_finished.connect(queue_free, [], CONNECT_DISCARD_EXTRA)

queue_free() isn't called without CONNECT_DISCARD_EXTRA.

HOWEVER, the "Too many arguments" error still appears despite successful call, so I have to fix it. Also the flag isn't available in connection dialog yet.

@Xrayez
Copy link
Contributor

Xrayez commented Apr 28, 2020

I wonder whether it makes more sense to discard extra arguments by default ("Too few arguments" would still be a valid error obviously).

@KoBeWi
Copy link
Member Author

KoBeWi commented Oct 11, 2020

Superseded by #42683
(although this could theoretically be applied for 3.2, because the other PR is completely incompatible)

@KoBeWi KoBeWi closed this Oct 11, 2020
@KoBeWi KoBeWi removed this from the 4.0 milestone Oct 11, 2020
@KoBeWi KoBeWi deleted the useless_args_are_useless branch November 25, 2022 15:08
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.

Allow to discard excessive arguments in signal connection
2 participants