Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Sources/OpenSwiftUI/View/Configuration/ViewAlias.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ private struct SourceFormula<Source>: AnySourceFormula where Source: View {
return .init()
}
return if source.valueIsNil == nil {
Optional<Source>.makeDebuggableView(
Source.makeDebuggableView(
view: _GraphValue(Attribute(identifier: attribute)),
inputs: inputs
)
} else {
Source.makeDebuggableView(
Optional<Source>.makeDebuggableView(

@augmentcode augmentcode Bot Jul 1, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sources/OpenSwiftUI/View/Configuration/ViewAlias.swift:233: In the source.valueIsNil != nil branch, using Optional<Source> here can become a double-optional (V??) since AnySource.init(Attribute<V?>) sets formula = SourceFormula<V?>, which may cause a mismatched Attribute(identifier:) cast at runtime. Can you confirm the intended Source generic in this branch is the non-optional wrapped view type (not already Optional<Wrapped>)?

Severity: medium

Other Locations
  • Sources/OpenSwiftUI/View/Configuration/ViewAlias.swift:254
  • Sources/OpenSwiftUI/View/Configuration/ViewAlias.swift:268

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

view: _GraphValue(Attribute(identifier: attribute)),
inputs: inputs
)
Expand All @@ -246,12 +246,12 @@ private struct SourceFormula<Source>: AnySourceFormula where Source: View {
return .emptyViewList(inputs: inputs)
}
return if source.valueIsNil == nil {
Optional<Source>.makeDebuggableViewList(
Source.makeDebuggableViewList(
view: _GraphValue(Attribute(identifier: attribute)),
inputs: inputs
)
} else {
Source.makeDebuggableViewList(
Optional<Source>.makeDebuggableViewList(
view: _GraphValue(Attribute(identifier: attribute)),
inputs: inputs
)
Expand All @@ -263,9 +263,9 @@ private struct SourceFormula<Source>: AnySourceFormula where Source: View {
inputs: _ViewListCountInputs
) -> Int? {
if source.valueIsNil == nil {
Optional<Source>._viewListCount(inputs: inputs)
} else {
Source._viewListCount(inputs: inputs)
} else {
Optional<Source>._viewListCount(inputs: inputs)
}
}
}
Expand Down
Loading