Repository navigation
fix(ios): build the edge-layout touch region from typed pieces - #29
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):(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@ViewBuilderfunction, so its whole body is solved as one constraint system. Therects: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 { [...] } ?? [], andwheel.map { [...] } ?? paletteFrame.map { [$0] } ?? []. The solver therefore tries every+overload (Array, RangeReplaceableCollection, SIMD, CGFloat, Measurement, …) against each??and literal choice.Color.clearis 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):edgeLayoutContent+(1431:25, 1432:25)Color.clearstatementChange
Three explicitly typed
[CGRect]lets ahead of theZStack(main controls, gear, palette or Wheel), concatenated in thecontentShapecall. These are the same expressions in the same order, soControlRegionShapegets 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
OpenSidecariOSgeneric-iOS Debug build succeeds, with no new warningsgit diff --checkis clean