Skip to content

Crash: Unexpectedly found nil while unwrapping an Optional value#790

Draft
jcmosc wants to merge 1 commit intoOpenSwiftUIProject:mainfrom
jcmosc:variadic-view-crash
Draft

Crash: Unexpectedly found nil while unwrapping an Optional value#790
jcmosc wants to merge 1 commit intoOpenSwiftUIProject:mainfrom
jcmosc:variadic-view-crash

Conversation

@jcmosc
Copy link
Contributor

@jcmosc jcmosc commented Feb 14, 2026

This contains a test case that reproduces a crash when nesting multi root variadic views:
#791

@augmentcode
Copy link

augmentcode bot commented Feb 14, 2026

🤖 Augment PR Summary

Summary: Adds a regression test reproducing a fatal optional-unwrapping crash when nesting variadic view roots.

Changes:

  • Introduces passthrough unary and multi variadic view roots for testing
  • Adds two Darwin-only tests that build nested _VariadicView.Tree hierarchies with Color.red/Color.blue
  • Drives rendering via ViewGraph and requests a .displayList output
  • Validates the produced display list structure using a regex match on displayList.description

Technical Notes: Tests run only under #if canImport(Darwin) and exercise the dynamic display-list path that previously hit the nil unwrap in ForEach internals.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

}

@Test
func nestedMultiViewRoot() {
Copy link

Choose a reason for hiding this comment

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

Since this PR adds only the repro test, if the underlying crash is still present this will abort the whole test run (fatal error) rather than reporting a normal test failure; is this intended to land only together with the fix or be marked as an expected failure until then?

Severity: medium

Other Locations
  • Tests/OpenSwiftUICoreTests/View/VariadicViewTests.swift:26

Fix This in Augment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant