-
Notifications
You must be signed in to change notification settings - Fork 112
Remove non-null upper bound for OutputT. #49
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
Conversation
workflow-core/src/main/java/com/squareup/workflow/WorkflowAction.kt
Outdated
Show resolved
Hide resolved
workflow-runtime/src/main/java/com/squareup/workflow/internal/WorkflowNode.kt
Outdated
Show resolved
Hide resolved
workflow-testing/src/main/java/com/squareup/workflow/testing/RenderTestResult.kt
Outdated
Show resolved
Hide resolved
workflow-runtime/src/main/java/com/squareup/workflow/internal/NoOutput.kt
Outdated
Show resolved
Hide resolved
5241a14 to
9216a69
Compare
|
Discussed testing and |
| * If this is already a [CancellationException], returns it as-is, otherwise wraps it in one with | ||
| * the given message. | ||
| */ | ||
| private inline fun Throwable?.toCancellationException(message: () -> String) = when (this) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, it stopped being used in an earlier PR but the deletion got left out of a rebase. I'm not sure why ktlint/compiler warnings for unused code didn't catch this actually.
workflow-runtime/src/main/java/com/squareup/workflow/internal/MaybeOutput.kt
Show resolved
Hide resolved
workflow-runtime/src/main/java/com/squareup/workflow/internal/MaybeOutput.kt
Show resolved
Hide resolved
| snapshotCache: Map<WorkflowNodeId, TreeSnapshot>, | ||
| private val contextForChildren: CoroutineContext, | ||
| private val emitActionToParent: (WorkflowAction<StateT, OutputT>) -> Any?, | ||
| private val emitActionToParent: (WorkflowAction<StateT, OutputT>) -> MaybeOutput<Any?>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need both MaybeOutput and OutputHolder? No strong feelings about it, just surprised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're both internal to their modules. To share them, we'd have to make one of them public, and I don't want to do that.
7efe64a to
e49357e
Compare
After #49 made outputs nullable, and introduced new `RenderTestResult` methods to handle nullable outputs (`verifyActionState`, `verifyActionOutput`, and `verifyNoActionOutput`), #64 came along and introduced a dedicated type for nullable outputs, `WorkflowOutput`. This type means that we can revert the `RenderTestResult` changes made in #49 and return to the simpler API with only `verifyAction` and `verifyActionResult` methods. This change does exactly that.
After #49 made outputs nullable, and introduced new `RenderTestResult` methods to handle nullable outputs (`verifyActionState`, `verifyActionOutput`, and `verifyNoActionOutput`), #64 came along and introduced a dedicated type for nullable outputs, `WorkflowOutput`. This type means that we can revert the `RenderTestResult` changes made in #49 and return to the simpler API with only `verifyAction` and `verifyActionResult` methods. This change does exactly that.
This should be the last unblocker for GUWT workers.
Fixes #59.