Skip to content

Swift 6.3-dev compiler crashes - workarounds applied #2

Description

@doozMen

Summary

Swift 6.3-dev (swift-DEVELOPMENT-SNAPSHOT-2025-12-11-a) crashes when compiling certain code patterns. This issue tracks the workarounds applied to enable building with Swift 6.3.

Compiler Bug

Assertion failed: (Start.isValid() == End.isValid() && "Start and end should either both be valid or both be invalid!"), function SourceRange, file SourceLoc.h, line 161.

Workarounds Applied

1. PrimaryKeyMigration.swift

  • SyncEngine.migratePrimaryKeys() - guarded with #if !compiler(>=6.3)
  • PrimaryKeyedTable.migratePrimaryKeyToUUID() - guarded with #if !compiler(>=6.3)
  • Reason: #sql macro + $backfillUUID macro-generated function crashes compiler

2. Statement+GRDB.swift

  • SelectStatement.find(_:key:) - guarded with #if !compiler(>=6.3)
  • Reason: Depends on Select.find() which is guarded in swift-structured-queries

Impact

  • Swift < 6.3: Full functionality available
  • Swift >= 6.3: CloudKit primary key migration and find(key:) methods unavailable

Related Changes in swift-structured-queries

  • PrimaryKeyed.swift - closures with opaque type sequences
  • Select.swift - variadic generics pack expansion

TODO

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions