Skip to content

Commit bf4b43f

Browse files
committed
Workaround the compiler crash for release build
1 parent 737cbb9 commit bf4b43f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Sources/OpenSwiftUICore/View/VariadicView_Children.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ package struct _ViewList_View: PrimitiveView, View, UnaryView {
178178
let placeholderInfo = PlaceholderInfo(
179179
placeholder: view.value,
180180
inputs: inputs,
181-
outputs: outputs,
182-
parentSubgraph: .current!
181+
outputs: outputs
183182
)
184183
let attribute = Attribute(placeholderInfo)
185184
outputs.setIndirectDependency(attribute.identifier)
@@ -202,6 +201,15 @@ private struct PlaceholderInfo: StatefulRule, ObservedAttribute, AsyncAttribute
202201
var contentObserver: (Subgraph, Int)?
203202
var lastPhase: Attribute<_GraphInputs.Phase>?
204203

204+
init(placeholder: Attribute<ViewList.View>, inputs: _ViewInputs, outputs: _ViewOutputs) {
205+
self._placeholder = placeholder
206+
self.inputs = inputs
207+
self.outputs = outputs
208+
// FIXME: The Subgraph.current call on the init default value or the call site will trigger a compiler crash (SIL -> IR) on Release build
209+
// We workaround it by setting it to .current here
210+
self.parentSubgraph = .current!
211+
}
212+
205213
struct Value {
206214
var id: ViewList.ID
207215
var seed: UInt32

0 commit comments

Comments
 (0)