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

Support ValueTask and Async bindings in testTask #489

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

farlee2121
Copy link
Collaborator

Fixes #488

Adds support for ValueTask, ValueTask, and Async bindings to the testTask expression.

This is accomplished through overloads of the Bind method.
I looked into inheriting the TaskBuilder, but it's constructor is hidden by the tasks.fsi file.

@@ -243,6 +243,13 @@ module Tests =
| Focused -> ftestCaseTask name a
| Pending -> ptestCaseTask name a

[<AutoOpen>]
module TestTaskExtensions =
type TestTaskBuilder with
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding these overloads as extensions helps the compiler know to prioritize the original Task overload, which prevents breakage in existing code that may have implicitly typed an expression based on Bind originally only taking variations of Task.

@farlee2121
Copy link
Collaborator Author

Any thoughts from @ratsclub before I merge?

@farlee2121 farlee2121 merged commit c2e3e2d into main Mar 15, 2024
3 checks passed
@farlee2121 farlee2121 deleted the task-expression-compatibility branch April 12, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

testTask doesn't handle the same bindings as task expressions
2 participants