@@ -117,10 +117,12 @@ public abstract class StatefulWorkflow<
117
117
name : String = "safeEventHandler",
118
118
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
119
119
::defaultOnFailedCast,
120
- crossinline update : // Type variance issue: https://github.com/square/workflow-kotlin/issues/891
121
- WorkflowAction <@UnsafeVariance PropsT , StateT , @UnsafeVariance OutputT >.Updater .(
122
- currentState: CurrentStateT
123
- ) -> Unit
120
+ // Type variance issue: https://github.com/square/workflow-kotlin/issues/891
121
+ crossinline update : WorkflowAction <
122
+ @UnsafeVariance PropsT ,
123
+ StateT ,
124
+ @UnsafeVariance OutputT
125
+ >.Updater .(currentState: CurrentStateT ) -> Unit
124
126
): () -> Unit {
125
127
return eventHandler({ name }) {
126
128
CurrentStateT ::class .safeCast(state)?.let { currentState -> this .update(currentState) }
@@ -132,8 +134,11 @@ public abstract class StatefulWorkflow<
132
134
name : String = "safeEventHandler",
133
135
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
134
136
::defaultOnFailedCast,
135
- crossinline update :
136
- WorkflowAction <@UnsafeVariance PropsT , StateT , @UnsafeVariance OutputT >.Updater .(
137
+ crossinline update : WorkflowAction <
138
+ @UnsafeVariance PropsT ,
139
+ StateT ,
140
+ @UnsafeVariance OutputT
141
+ >.Updater .(
137
142
currentState: CurrentStateT ,
138
143
event: EventT
139
144
) -> Unit
@@ -149,8 +154,11 @@ public abstract class StatefulWorkflow<
149
154
name : String = "safeEventHandler",
150
155
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
151
156
::defaultOnFailedCast,
152
- crossinline update :
153
- WorkflowAction <@UnsafeVariance PropsT , StateT , @UnsafeVariance OutputT >.Updater .(
157
+ crossinline update : WorkflowAction <
158
+ @UnsafeVariance PropsT ,
159
+ StateT ,
160
+ @UnsafeVariance OutputT
161
+ >.Updater .(
154
162
currentState: CurrentStateT ,
155
163
e1: E1 ,
156
164
e2: E2
@@ -167,8 +175,11 @@ public abstract class StatefulWorkflow<
167
175
name : String = "safeEventHandler",
168
176
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
169
177
::defaultOnFailedCast,
170
- crossinline update :
171
- WorkflowAction <@UnsafeVariance PropsT , StateT , @UnsafeVariance OutputT >.Updater .(
178
+ crossinline update : WorkflowAction <
179
+ @UnsafeVariance PropsT ,
180
+ StateT ,
181
+ @UnsafeVariance OutputT
182
+ >.Updater .(
172
183
currentState: CurrentStateT ,
173
184
e1: E1 ,
174
185
e2: E2 ,
@@ -186,8 +197,11 @@ public abstract class StatefulWorkflow<
186
197
name : String = "safeEventHandler",
187
198
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
188
199
::defaultOnFailedCast,
189
- crossinline update :
190
- WorkflowAction <@UnsafeVariance PropsT , StateT , @UnsafeVariance OutputT >.Updater .(
200
+ crossinline update : WorkflowAction <
201
+ @UnsafeVariance PropsT ,
202
+ StateT ,
203
+ @UnsafeVariance OutputT
204
+ >.Updater .(
191
205
currentState: CurrentStateT ,
192
206
e1: E1 ,
193
207
e2: E2 ,
@@ -206,8 +220,11 @@ public abstract class StatefulWorkflow<
206
220
name : String = "safeEventHandler",
207
221
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
208
222
::defaultOnFailedCast,
209
- crossinline update :
210
- WorkflowAction <@UnsafeVariance PropsT , StateT , @UnsafeVariance OutputT >.Updater .(
223
+ crossinline update : WorkflowAction <
224
+ @UnsafeVariance PropsT ,
225
+ StateT ,
226
+ @UnsafeVariance OutputT
227
+ >.Updater .(
211
228
currentState: CurrentStateT ,
212
229
e1: E1 ,
213
230
e2: E2 ,
@@ -235,8 +252,11 @@ public abstract class StatefulWorkflow<
235
252
name : String = "safeEventHandler",
236
253
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
237
254
::defaultOnFailedCast,
238
- crossinline update :
239
- WorkflowAction <@UnsafeVariance PropsT , StateT , @UnsafeVariance OutputT >.Updater .(
255
+ crossinline update : WorkflowAction <
256
+ @UnsafeVariance PropsT ,
257
+ StateT ,
258
+ @UnsafeVariance OutputT
259
+ >.Updater .(
240
260
currentState: CurrentStateT ,
241
261
e1: E1 ,
242
262
e2: E2 ,
@@ -266,8 +286,11 @@ public abstract class StatefulWorkflow<
266
286
name : String = "safeEventHandler",
267
287
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
268
288
::defaultOnFailedCast,
269
- crossinline update :
270
- WorkflowAction <@UnsafeVariance PropsT , StateT , @UnsafeVariance OutputT >.Updater .(
289
+ crossinline update : WorkflowAction <
290
+ @UnsafeVariance PropsT ,
291
+ StateT ,
292
+ @UnsafeVariance OutputT
293
+ >.Updater .(
271
294
currentState: CurrentStateT ,
272
295
e1: E1 ,
273
296
e2: E2 ,
@@ -299,8 +322,11 @@ public abstract class StatefulWorkflow<
299
322
name : String = "safeEventHandler",
300
323
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
301
324
::defaultOnFailedCast,
302
- crossinline update :
303
- WorkflowAction <@UnsafeVariance PropsT , StateT , @UnsafeVariance OutputT >.Updater .(
325
+ crossinline update : WorkflowAction <
326
+ @UnsafeVariance PropsT ,
327
+ StateT ,
328
+ @UnsafeVariance OutputT
329
+ >.Updater .(
304
330
currentState: CurrentStateT ,
305
331
e1: E1 ,
306
332
e2: E2 ,
@@ -336,8 +362,11 @@ public abstract class StatefulWorkflow<
336
362
name : String = "safeEventHandler",
337
363
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
338
364
::defaultOnFailedCast,
339
- crossinline update :
340
- WorkflowAction <@UnsafeVariance PropsT , StateT , @UnsafeVariance OutputT >.Updater .(
365
+ crossinline update : WorkflowAction <
366
+ @UnsafeVariance PropsT ,
367
+ StateT ,
368
+ @UnsafeVariance OutputT
369
+ >.Updater .(
341
370
currentState: CurrentStateT ,
342
371
e1: E1 ,
343
372
e2: E2 ,
@@ -375,8 +404,11 @@ public abstract class StatefulWorkflow<
375
404
name : String = "safeEventHandler",
376
405
crossinline onFailedCast : (name: String , type: KClass <* >, state: StateT ) -> Unit =
377
406
::defaultOnFailedCast,
378
- crossinline update :
379
- WorkflowAction <@UnsafeVariance PropsT , StateT , @UnsafeVariance OutputT >.Updater .(
407
+ crossinline update : WorkflowAction <
408
+ @UnsafeVariance PropsT ,
409
+ StateT ,
410
+ @UnsafeVariance OutputT
411
+ >.Updater .(
380
412
currentState: CurrentStateT ,
381
413
e1: E1 ,
382
414
e2: E2 ,
0 commit comments