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 tests for signal await with parameters #90398

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Apr 8, 2024

You can await a signal and assign the result to a variable. It will be null, Variant or Array, depending on emitted signal parameters.

This feature doesn't seem documented anywhere and it's generally not very known, so this PR adds some tests so it's not lost at least.

@KoBeWi KoBeWi added this to the 4.3 milestone Apr 8, 2024
@KoBeWi KoBeWi requested a review from a team as a code owner April 8, 2024 17:15
@kleonc
Copy link
Member

kleonc commented Apr 8, 2024

This feature doesn't seem documented anywhere and it's generally not very known

Note it's documented in 3.x for yielding on a signal. So for those familiar with 3.x it's kinda expectable it works like that (but indeed should be documented for await).


BTW when getting an array from awaiting a signal it's still indistinguishable whether the signal was emitted with a single array argument or with multiple arguments. Probably should be explicitly noted when being documented.

@akien-mga akien-mga merged commit dd926b9 into godotengine:master Apr 8, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the secret_features👀 branch April 8, 2024 20:20
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.

3 participants