Normalize Swift toolchain and use raw identifiers for test names - #5
Merged
Conversation
Every target opts into a shared `upcomingFeatures` array covering NonisolatedNonsendingByDefault, InferIsolatedConformances, ImmutableWeakCaptures, MemberImportVisibility, ExistentialAny, and InternalImportsByDefault. The tools version stays at 6.2 and the package keeps building in language modes 5 and 6, so existing consumers are unaffected. InternalImportsByDefault required `public import Foundation` in the eight files whose public API exposes Foundation types, plus `public import CoreLocation` for the `coreLocation` accessor on `Obstacle`; the remaining files keep Foundation internal. ExistentialAny added `any` to fifteen existential parameter and property types across the library and the E2E tool. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EtA5RwfPWtcxu2NfAHfjAr
All 59 tests name themselves with SE-0451 raw identifiers instead of `@Test` display-name strings, so the declaration and the reported test name are one thing. Each name reads as a lowercase third-person verb phrase describing the behavior under test rather than the title-case noun phrase the display strings used. The three suite types keep their `CycleTests`, `DOFTests`, and `ObstacleTests` names, none of which shadow a type under test. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EtA5RwfPWtcxu2NfAHfjAr
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.
Toolchain settings
Package.swiftnow points every target at a singleupcomingFeaturesarray:NonisolatedNonsendingByDefault,InferIsolatedConformances(already enabled)ImmutableWeakCaptures,MemberImportVisibility,ExistentialAny,InternalImportsByDefault(new)The tools version stays at 6.2 and the package keeps
swiftLanguageModes: [.v5, .v6], soexisting consumers are unaffected.
Fallout, all mechanical:
InternalImportsByDefault— eight files whose public API exposes Foundation types now saypublic import Foundation(DOF,Cycle,Obstacle,AccuracyCategory,ByteInitializable,DOFError, andByteParsing, the last because its@inlinable toString()callsString(bytes:encoding:)).Obstacle.swiftalso getspublic import CoreLocationfor thecoreLocationaccessor. Every other file keeps Foundation internal.ExistentialAny— 15anyannotations added byswift package migrate, across the libraryand the
SwiftDOF_E2Etool.ImmutableWeakCaptures— no occurrences.Raw identifiers for test names
SE-0451 makes
@Test("…")display-name strings redundant, so all 59 tests name themselves:Names were regenerated as lowercase third-person verb phrases rather than the title-case noun
phrases the display strings used —
"Count property"became`counts the parsed obstacles`,"Measurement extension - height AGL"became`exposes the height AGL as a measurement in feet`, and so on. The three suite types keeptheir
CycleTests/DOFTests/ObstacleTestsnames; none shadows a type under test.CI
The matrix already runs macos-26 + Swift 6.2 and ubuntu-latest + Swift 6.3, both new enough for
raw identifiers, so both legs still build and test. Only the stale policy header changed: it had
said "when Swift 6.3 ships, bump 6.0→6.1", which has happened, and it now records the Swift 6.2
floor that raw identifiers impose on any leg running
swift test.Verification
Run locally on Swift 6.3.3 / Xcode 26.6:
swift buildfrom a clean.build— zero errors, zero warningsswift test— 59 tests in 3 suites, all passingswift format lint --strict -r .— cleanswiftlint --strict— 0 violations in 23 filesswift package dump-package— cleanactionlint .github/workflows/ci.yml— cleanFor reviewers
The
public importset is worth a look — it was derived from the compiler's own"not used in public declarations" warnings, iterated to a fixed point, so it should be minimal,
but it reflects what macOS compiles.
LinuxLocalization.swiftsits behind#if !canImport(Darwin)and is not compiled locally; its
import Foundationis left internal because theStringextension it declares is internal, which the Linux CI leg will confirm.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EtA5RwfPWtcxu2NfAHfjAr