fix(tests): break up Bézier expressions that time out Swift type-checking#9
Merged
Merged
Conversation
…king CI on main fails compiling ScreenOutlineTests.swift under Xcode 26.3: "the compiler is unable to type-check this expression in reasonable time" at the applyWithBlock closure in flattenedPoints. The chained quad/cubic Bézier arithmetic mixing untyped integer literals with CGFloat inside an inferred closure blows the type-checker's budget. Hoist the sampling math into quadPoint/cubicPoint helpers with explicitly typed CGFloat coefficients, as the diagnostic suggests. No behavior change; all 41 tests pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
CI on
mainhas been red since #8 landed: thePowerSnekKitTeststarget fails to compile on the macos-15/arm64 runner (Xcode 26.3, Swift 6 mode), so testing is cancelled before any test runs.The
flattenedPointshelper's closure contains long chained quad/cubic Bézier arithmetic that mixes untyped integer literals withCGFloat(e.g.mt * mt * mt * p0.x + 3 * mt * mt * t * c1.x + …). Inside a closure with inferred parameter types, the constraint solver explores a combinatorial number of overloads for*/+and exceeds its time budget.Fix
Hoist the sampling math into
quadPoint/cubicPointhelpers with explicitlyCGFloat-typed coefficient locals, exactly as the diagnostic suggests. The closure branches now just call the helpers. No behavior change.Verification
Ran the same command CI uses (
xcodebuild test -project PowerSnek.xcodeproj -scheme PowerSnek -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO): the test target compiles and all 41 tests pass, including the 7ScreenOutlineTests.🤖 Generated with Claude Code