Skip to content

Normalize Swift toolchain and use raw identifiers for test names - #5

Merged
RISCfuture merged 2 commits into
mainfrom
swift-6.3-raw-identifiers
Sep 4, 2026
Merged

Normalize Swift toolchain and use raw identifiers for test names#5
RISCfuture merged 2 commits into
mainfrom
swift-6.3-raw-identifiers

Conversation

@RISCfuture

Copy link
Copy Markdown
Owner

Toolchain settings

Package.swift now points every target at a single upcomingFeatures array:

  • NonisolatedNonsendingByDefault, InferIsolatedConformances (already enabled)
  • ImmutableWeakCaptures, MemberImportVisibility, ExistentialAny, InternalImportsByDefault (new)

The tools version stays at 6.2 and the package keeps swiftLanguageModes: [.v5, .v6], so
existing consumers are unaffected.

Fallout, all mechanical:

  • InternalImportsByDefault — eight files whose public API exposes Foundation types now say
    public import Foundation (DOF, Cycle, Obstacle, AccuracyCategory, ByteInitializable,
    DOFError, and ByteParsing, the last because its @inlinable toString() calls
    String(bytes:encoding:)). Obstacle.swift also gets public import CoreLocation for the
    coreLocation accessor. Every other file keeps Foundation internal.
  • ExistentialAny — 15 any annotations added by swift package migrate, across the library
    and the SwiftDOF_E2E tool.
  • ImmutableWeakCaptures — no occurrences.

Raw identifiers for test names

SE-0451 makes @Test("…") display-name strings redundant, so all 59 tests name themselves:

@Test
func `parses the currency date header into a cycle`() throws

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 keep
their CycleTests / DOFTests / ObstacleTests names; 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 build from a clean .build — zero errors, zero warnings
  • swift test — 59 tests in 3 suites, all passing
  • swift format lint --strict -r . — clean
  • swiftlint --strict — 0 violations in 23 files
  • swift package dump-package — clean
  • actionlint .github/workflows/ci.yml — clean

For reviewers

The public import set 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.swift sits behind #if !canImport(Darwin)
and is not compiled locally; its import Foundation is left internal because the String
extension it declares is internal, which the Linux CI leg will confirm.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EtA5RwfPWtcxu2NfAHfjAr

RISCfuture and others added 2 commits September 4, 2026 00:20
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
@RISCfuture
RISCfuture merged commit e1bb85c into main Sep 4, 2026
6 checks passed
@RISCfuture
RISCfuture deleted the swift-6.3-raw-identifiers branch September 4, 2026 17:12
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