Skip to content

Commit 55a5f97

Browse files
committed
Ktlint tweaks
1 parent 6395d0b commit 55a5f97

File tree

1 file changed

+56
-24
lines changed

1 file changed

+56
-24
lines changed

workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatefulWorkflow.kt

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ public abstract class StatefulWorkflow<
117117
name: String = "safeEventHandler",
118118
crossinline onFailedCast: (name: String, type: KClass<*>, state: StateT) -> Unit =
119119
::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
124126
): () -> Unit {
125127
return eventHandler({ name }) {
126128
CurrentStateT::class.safeCast(state)?.let { currentState -> this.update(currentState) }
@@ -132,8 +134,11 @@ public abstract class StatefulWorkflow<
132134
name: String = "safeEventHandler",
133135
crossinline onFailedCast: (name: String, type: KClass<*>, state: StateT) -> Unit =
134136
::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.(
137142
currentState: CurrentStateT,
138143
event: EventT
139144
) -> Unit
@@ -149,8 +154,11 @@ public abstract class StatefulWorkflow<
149154
name: String = "safeEventHandler",
150155
crossinline onFailedCast: (name: String, type: KClass<*>, state: StateT) -> Unit =
151156
::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.(
154162
currentState: CurrentStateT,
155163
e1: E1,
156164
e2: E2
@@ -167,8 +175,11 @@ public abstract class StatefulWorkflow<
167175
name: String = "safeEventHandler",
168176
crossinline onFailedCast: (name: String, type: KClass<*>, state: StateT) -> Unit =
169177
::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.(
172183
currentState: CurrentStateT,
173184
e1: E1,
174185
e2: E2,
@@ -186,8 +197,11 @@ public abstract class StatefulWorkflow<
186197
name: String = "safeEventHandler",
187198
crossinline onFailedCast: (name: String, type: KClass<*>, state: StateT) -> Unit =
188199
::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.(
191205
currentState: CurrentStateT,
192206
e1: E1,
193207
e2: E2,
@@ -206,8 +220,11 @@ public abstract class StatefulWorkflow<
206220
name: String = "safeEventHandler",
207221
crossinline onFailedCast: (name: String, type: KClass<*>, state: StateT) -> Unit =
208222
::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.(
211228
currentState: CurrentStateT,
212229
e1: E1,
213230
e2: E2,
@@ -235,8 +252,11 @@ public abstract class StatefulWorkflow<
235252
name: String = "safeEventHandler",
236253
crossinline onFailedCast: (name: String, type: KClass<*>, state: StateT) -> Unit =
237254
::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.(
240260
currentState: CurrentStateT,
241261
e1: E1,
242262
e2: E2,
@@ -266,8 +286,11 @@ public abstract class StatefulWorkflow<
266286
name: String = "safeEventHandler",
267287
crossinline onFailedCast: (name: String, type: KClass<*>, state: StateT) -> Unit =
268288
::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.(
271294
currentState: CurrentStateT,
272295
e1: E1,
273296
e2: E2,
@@ -299,8 +322,11 @@ public abstract class StatefulWorkflow<
299322
name: String = "safeEventHandler",
300323
crossinline onFailedCast: (name: String, type: KClass<*>, state: StateT) -> Unit =
301324
::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.(
304330
currentState: CurrentStateT,
305331
e1: E1,
306332
e2: E2,
@@ -336,8 +362,11 @@ public abstract class StatefulWorkflow<
336362
name: String = "safeEventHandler",
337363
crossinline onFailedCast: (name: String, type: KClass<*>, state: StateT) -> Unit =
338364
::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.(
341370
currentState: CurrentStateT,
342371
e1: E1,
343372
e2: E2,
@@ -375,8 +404,11 @@ public abstract class StatefulWorkflow<
375404
name: String = "safeEventHandler",
376405
crossinline onFailedCast: (name: String, type: KClass<*>, state: StateT) -> Unit =
377406
::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.(
380412
currentState: CurrentStateT,
381413
e1: E1,
382414
e2: E2,

0 commit comments

Comments
 (0)