-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
needed to use the DefaultValue attribute on the Zero member of the CEs
- Loading branch information
1 parent
13e2d7b
commit 71f04ac
Showing
4 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -514,17 +514,19 @@ type TaskOptionBuilderBase() = | |
TaskOptionCode<'TOverall, 'T>(fun sm -> (generator ()).Invoke(&sm)) | ||
|
||
/// Used to represent no-ops like the implicit empty "else" branch of an "if" expression. | ||
// [<DefaultValue>] // TODO: Figureout if this attribute is needed, without it it allows tests to pass with implicit else branches resulting in `Some ()` | ||
member inline _.Zero<'TOverall>() : TaskOptionCode<'TOverall, unit> = ResumableCode.Zero() | ||
[<DefaultValue>] | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
TheAngryByrd
Author
Collaborator
|
||
member inline _.Zero<'TOverall>() : TaskOptionCode<'TOverall, unit> = | ||
TaskOptionCode<_, _> | ||
(fun sm -> | ||
sm.Data.Result <- ValueSome(Some Unchecked.defaultof<'TOverall>) | ||
true) | ||
|
||
member inline _.Return(value: 'T) : TaskOptionCode<'T, 'T> = | ||
TaskOptionCode<'T, _> | ||
(fun sm -> | ||
sm.Data.Result <- ValueSome(Some value) | ||
true) | ||
|
||
|
||
|
||
static member inline CombineDynamic | ||
( | ||
sm: byref<TaskOptionStateMachine<_>>, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Guess we've figured it out :P. Much obliged.