@@ -74,7 +74,7 @@ extension AnyWorkflow {
7474 /// That type information *is* present in our storage object, however, so we
7575 /// pass the context down to that storage object which will ultimately call
7676 /// through to `context.render(workflow:key:reducer:)`.
77- internal func render< Parent> ( context: RenderContext < Parent > , key: String , outputMap: @escaping ( Output ) -> AnyWorkflowAction < Parent > ) -> Rendering {
77+ internal func render< Parent, Action > ( context: RenderContext < Parent > , key: String , outputMap: @escaping ( Output ) -> Action ) -> Rendering where Action : WorkflowAction , Action . WorkflowType == Parent {
7878 return storage. render ( context: context, key: key, outputMap: outputMap)
7979 }
8080}
@@ -84,7 +84,7 @@ extension AnyWorkflow {
8484 ///
8585 /// This type is never used directly.
8686 fileprivate class AnyStorage {
87- func render< Parent> ( context: RenderContext < Parent > , key: String , outputMap: @escaping ( Output ) -> AnyWorkflowAction < Parent > ) -> Rendering {
87+ func render< Parent, Action > ( context: RenderContext < Parent > , key: String , outputMap: @escaping ( Output ) -> Action ) -> Rendering where Action : WorkflowAction , Action . WorkflowType == Parent {
8888 fatalError ( )
8989 }
9090
@@ -119,8 +119,8 @@ extension AnyWorkflow {
119119 return T . self
120120 }
121121
122- override func render< Parent> ( context: RenderContext < Parent > , key: String , outputMap: @escaping ( Output ) -> AnyWorkflowAction < Parent > ) -> Rendering {
123- let outputMap : ( T . Output ) -> AnyWorkflowAction < Parent > = { [ outputTransform] output in
122+ override func render< Parent, Action > ( context: RenderContext < Parent > , key: String , outputMap: @escaping ( Output ) -> Action ) -> Rendering where Action : WorkflowAction , Action . WorkflowType == Parent {
123+ let outputMap : ( T . Output ) -> Action = { [ outputTransform] output in
124124 outputMap ( outputTransform ( output) )
125125 }
126126 let rendering = context. render ( workflow: workflow, key: key, outputMap: outputMap)
0 commit comments