Skip to content

fix(ios): build the edge-layout touch region from typed pieces - #29

Merged
raiseCatError merged 1 commit into
release/app-store-rcfrom
fix/ios-swiftui-typecheck-ci
Oct 26, 2026
Merged

raiseCatError merged 1 commit into
release/app-store-rcfrom
fix/ios-swiftui-typecheck-ci

Conversation

@raiseCatError

@raiseCatError raiseCatError commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Problem

The Tests workflow fails on every draft PR based on release/app-store-rc (#24–#28) at Build iOS receiver app on Xcode 26.6 (macos-26 runner, iPhoneOS 26.5 SDK, Debug):

iOS/ReceiverControls.swift:1426:13: error: the compiler is unable to type-check this expression in reasonable time

(Line 1488 on #27, which only shifts the same code down.) The Mac tests in those runs pass; only the iOS build fails. Local Xcode 27.1 (Swift 6.4) compiles the same code.

Cause

edgeLayoutContent(mode:container:) is a @ViewBuilder function, so its whole body is solved as one constraint system. The rects: argument of the Strip/Overlay hit region joined three operands with +, and none of them had a known type: a ternary with an empty [], gearFrame.map { [...] } ?? [], and wheel.map { [...] } ?? paletteFrame.map { [$0] } ?? []. The solver therefore tries every + overload (Array, RangeReplaceableCollection, SIMD, CGFloat, Measurement, …) against each ?? and literal choice. Color.clear is only where the diagnostic lands, at the start of the statement.

Measured locally with Swift 6.4, with its newer solver optimisations turned off to approximate Xcode 26's solver (-solver-disable-prune-disjunctions -solver-disable-prepared-overloads -solver-disable-optimize-operator-defaults):

before after
solver scopes for edgeLayoutContent 175,502 14,049
trail steps 4.43 M 358 K
disjunction attempts at the two + (1431:25, 1432:25) 125,130 —
Color.clear statement 1,208 ms below the 200 ms report threshold

Change

Three explicitly typed [CGRect] lets ahead of the ZStack (main controls, gear, palette or Wheel), concatenated in the contentShape call. These are the same expressions in the same order, so ControlRegionShape gets the same rects. The view tree, modifiers, gesture and hit-testing are unchanged. The Custom layout's hit region (which type-checks fine on CI) is untouched.

Verification

Xcode 26.6's type checker gives up on the Strip/Overlay hit region in
edgeLayoutContent (ReceiverControls.swift:1426): two `+` concatenations
over an untyped ternary, `Optional.map { [...] } ?? []` and a `??` chain
make the solver try every `+` overload together with each `??` and
literal choice. Built as three [CGRect] lets ahead of the ZStack, the
same rects, in the same order, reach ControlRegionShape.
@raiseCatError
raiseCatError marked this pull request as ready for review October 26, 2026 10:06
@raiseCatError
raiseCatError merged commit 65d46e8 into release/app-store-rc Oct 26, 2026
3 checks passed
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