swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.27k stars 10.33k forks source link

Compilation error related to `@TaskLocal` on the latest nightly toolchains. #73793

Closed fibrechannelscsi closed 3 months ago

fibrechannelscsi commented 3 months ago

Description

The code below fails to compile on the latest nightly toolchains. The error generated is: macro type 'SwiftMacros.TaskLocalMacro' not found when expanding macro 'TaskLocal '

Reproduction

Copy and paste the following code into a new project, and build in Debug mode.

struct A {@TaskLocal static var a: Self?}

Expected behavior

The compilation should succeed.

Environment

Nightly toolchains 2024-05-14a and 2024-05-15a are affected. Toolchains in the range of 2023-07-10a to 2024-05-01a build this correctly.

Additional information

This prevents certain packages from building; one example is XCTest Dynamic Overlay: https://github.com/pointfreeco/xctest-dynamic-overlay

fibrechannelscsi commented 3 months ago

This is fixed as of the 2024-06-04a toolchain.