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

Fix void-Task coallescence #1

Merged
merged 1 commit into from
Aug 21, 2023
Merged

Fix void-Task coallescence #1

merged 1 commit into from
Aug 21, 2023

Conversation

VelvetToroyashi
Copy link

This PR fixes an issue I mentioned here, in regards to accidentally marshalling Tasks as their runtime type instead of undefined

@VelvetToroyashi VelvetToroyashi changed the base branch from main to feature/task-promise-conversion August 18, 2023 13:41
This commit fixes an issue where an `async Task` (be it a method or a delegate)
would end up being marshalled directly to JS, giving a `Task<VoidTaskResult>`
to the user, instead of `undefined`, which is what is returned for
"synchronous tasks", i.e. any Task-returning invokable function that does
not generate an async state machine of its own (that is to say, any function
that returns `Task`, not `async Task`.

This commit fixes the issue by checking if a Task's result is equal to
`VoidTaskResult`, which is an internal type used by the runtime to indicate
a void-returning Task, such as that from an `async Task` method/delegate
@Xicy Xicy merged commit 2bc575d into Xicy:feature/task-promise-conversion Aug 21, 2023
@Xicy
Copy link
Owner

Xicy commented Aug 21, 2023

@VelvetToroyashi Thank you for contribute 🎊

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