Skip to content

Commit eaf1925

Browse files
Make RenderingProduced not a value class.
Value classes get boxed as soon as they're used as a supertype, so it's basically pointless to make sealed class children value classes. I made it a data class instead. This change is required to move `:workflow-runtime-android` into `:workflow-runtime`, or we get a compiler crash. I also made the object siblings data objects to fix a compiler suggestion and get better `toString` methods.
1 parent 521c135 commit eaf1925

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

workflow-runtime/api/workflow-runtime.api

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,27 @@ public final class com/squareup/workflow1/WorkflowInterceptor$RenderContextInter
8989

9090
public final class com/squareup/workflow1/WorkflowInterceptor$RenderPassSkipped : com/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate {
9191
public static final field INSTANCE Lcom/squareup/workflow1/WorkflowInterceptor$RenderPassSkipped;
92+
public fun equals (Ljava/lang/Object;)Z
93+
public fun hashCode ()I
94+
public fun toString ()Ljava/lang/String;
9295
}
9396

9497
public final class com/squareup/workflow1/WorkflowInterceptor$RenderingConflated : com/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate {
9598
public static final field INSTANCE Lcom/squareup/workflow1/WorkflowInterceptor$RenderingConflated;
99+
public fun equals (Ljava/lang/Object;)Z
100+
public fun hashCode ()I
101+
public fun toString ()Ljava/lang/String;
96102
}
97103

98104
public final class com/squareup/workflow1/WorkflowInterceptor$RenderingProduced : com/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate {
99-
public static final synthetic fun box-impl (Lcom/squareup/workflow1/RenderingAndSnapshot;)Lcom/squareup/workflow1/WorkflowInterceptor$RenderingProduced;
100-
public static fun constructor-impl (Lcom/squareup/workflow1/RenderingAndSnapshot;)Lcom/squareup/workflow1/RenderingAndSnapshot;
105+
public fun <init> (Lcom/squareup/workflow1/RenderingAndSnapshot;)V
106+
public final fun component1 ()Lcom/squareup/workflow1/RenderingAndSnapshot;
107+
public final fun copy (Lcom/squareup/workflow1/RenderingAndSnapshot;)Lcom/squareup/workflow1/WorkflowInterceptor$RenderingProduced;
108+
public static synthetic fun copy$default (Lcom/squareup/workflow1/WorkflowInterceptor$RenderingProduced;Lcom/squareup/workflow1/RenderingAndSnapshot;ILjava/lang/Object;)Lcom/squareup/workflow1/WorkflowInterceptor$RenderingProduced;
101109
public fun equals (Ljava/lang/Object;)Z
102-
public static fun equals-impl (Lcom/squareup/workflow1/RenderingAndSnapshot;Ljava/lang/Object;)Z
103-
public static final fun equals-impl0 (Lcom/squareup/workflow1/RenderingAndSnapshot;Lcom/squareup/workflow1/RenderingAndSnapshot;)Z
104110
public final fun getRenderingAndSnapshot ()Lcom/squareup/workflow1/RenderingAndSnapshot;
105111
public fun hashCode ()I
106-
public static fun hashCode-impl (Lcom/squareup/workflow1/RenderingAndSnapshot;)I
107112
public fun toString ()Ljava/lang/String;
108-
public static fun toString-impl (Lcom/squareup/workflow1/RenderingAndSnapshot;)Ljava/lang/String;
109-
public final synthetic fun unbox-impl ()Lcom/squareup/workflow1/RenderingAndSnapshot;
110113
}
111114

112115
public abstract interface class com/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate {

workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/WorkflowInterceptor.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,22 +172,21 @@ public interface WorkflowInterceptor {
172172
* A render pass has been skipped by an optimization, multiple actions are applied before
173173
* the runtime produces a rendering.
174174
*/
175-
public object RenderPassSkipped : RuntimeUpdate
175+
public data object RenderPassSkipped : RuntimeUpdate
176176

177177
/**
178178
* The runtime skipped producing a rendering, conflating it to the next rendering after the next
179179
* render pass.
180180
*/
181-
public object RenderingConflated : RuntimeUpdate
181+
public data object RenderingConflated : RuntimeUpdate
182182

183183
/**
184184
* This runtime has produced a new rendering after at least one render pass.
185185
*
186186
* @param renderingAndSnapshot This is the rendering and snapshot that was passed out of the
187187
* Workflow runtime.
188188
*/
189-
@JvmInline
190-
public value class RenderingProduced<R>(
189+
public data class RenderingProduced<R>(
191190
public val renderingAndSnapshot: RenderingAndSnapshot<R>
192191
) : RuntimeUpdate
193192

0 commit comments

Comments
 (0)