Tests: declare Instantiable conformance directly in fixtures#260
Merged
Conversation
Update every @INSTANTIABLE test fixture to declare `: Instantiable` itself, matching how production code is written and what the macro requires. The fixtures have been getting away without the conformance because the generator tests parse them as strings rather than expanding the macro. Declaring the conformance explicitly makes the fixtures match what the macro demands of production code, eliminates a quiet divergence from real-world usage, and unblocks downstream work that actually compiles these fixtures end-to-end. This is a pure test-fixture refactor — no production source changes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #260 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 41 41
Lines 6369 6369
=========================================
Hits 6369 6369 🚀 New features to boost your workflow:
|
dfed
added a commit
that referenced
this pull request
Apr 19, 2026
…sions `@Instantiable(conformsElsewhere: true)` tells the macro the conformance is declared elsewhere, so the decorated declaration must NOT also declare `: Instantiable`. PR #260 blindly added the conformance to every fixture, including these four `extension Array` cases — making the decoration self-contradictory. Drop `: Instantiable` from the four affected extensions so the decoration matches its meaning. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
@Instantiabletest fixture to declare: Instantiableitself, matching how production code is written and what the macro requires.Why
The fixtures have been getting away without the conformance because the generator tests parse them as strings rather than expanding the macro. Declaring the conformance explicitly makes the fixtures match what the macro demands of production code, eliminates a quiet divergence from real-world usage, and unblocks downstream work that actually compiles these fixtures end-to-end.
Test plan
swift build --traits sourceBuildswift test --traits sourceBuild(all 831 tests pass)./CLI/lint.sh(no formatting changes)🤖 Generated with Claude Code