Skip to content

SwiftSyntax 603.0.1 passes build but breaks expression macro compiler-plugin arguments under Apple Swift 6.3.1 #3322

Description

@naykutguven

Description

Description

Expression macro compiler-plugin tests that pass with SwiftSyntax 602.0.0 fail with SwiftSyntax 603.0.1 under Apple Swift 6.3.1.

The package builds successfully with 603.0.1, but compiler-plugin expansion tests fail as if the freestanding expression macro invocation arguments are missing or malformed.

Environment

  • macOS:
  • Xcode: 26.4.1
  • Swift: Apple Swift version 6.3.1
  • swift-driver: 1.148.6
  • SwiftSyntax passing version: 602.0.0
  • SwiftSyntax failing version: 603.0.1
  • SwiftSyntax 603.0.1 revision observed: 9de99a7

Reproduction

Using this package:

https://github.com/naykutguven/ConcurrencyMacros

Change the SwiftSyntax dependency from the verified 602 range to 603:

let swiftSyntaxRange = Version(603, 0, 0)..<Version(604, 0, 0)

Then run:

swift package resolve
swift build
swift test

Expected Behavior

The expression macro tests should pass as they do with SwiftSyntax 602.0.0.

Actual Behavior

swift build succeeds, but swift test fails in expression macro compiler-plugin tests.

Observed examples:

  • #withTimeout(.seconds(1)) reports that it requires a duration as its first argument.
  • #concurrentMap([1, 2, 3], limit: 2) reports that it requires a sequence as its first argument.
  • #retrying(...) fails to receive a result from the plugin.

This suggests the macro implementation is receiving a FreestandingMacroExpansionSyntax whose argument list is empty or malformed during compiler-plugin expansion.

A/B Result

With the same package code and local Swift 6.3.1 toolchain:

  • SwiftSyntax 602.0.0: swift test passes.
  • SwiftSyntax 603.0.1: swift build passes, swift test fails during expression macro expansion.

Notes

I have not isolated the exact SwiftSyntax source line. The likely area is the SwiftSyntax 603 compiler-plugin message handling / reparse path, since 603 introduced changes around static build configuration and parser Swift version / experimental feature handling.

Steps to Reproduce

Using this package:

https://github.com/naykutguven/ConcurrencyMacros

Change the SwiftSyntax dependency from the verified 602 range to 603:

let swiftSyntaxRange = Version(603, 0, 0)..<Version(604, 0, 0)

Then run:

swift package resolve
swift build
swift test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions