[6.0] [Macro] Compiler error when producing extension macro with @preconcurrency
attribute
#76745
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
swift macro
Feature → declarations: Swift `macro` declarations
Description
If an extension macro produces an extension that declares conformance to a protocol with
@preconcurrency
attribute. The compiler gives error:But inlining the macro expansion, code is compiled without any error.
For example let's suppose
@Codable
is an extension macro that producesDecodable
conformance to actor, i.e.produces an extension declaration
Compiler shows following error for produced expansion:
Reproduction
Add
MetaCodable
swift package: https://github.com/SwiftyLab/MetaCodable targeting branchswift-testing
.Add an actor declaration with
@Codable
macro attached, i.e.See the error when macro expanded during compile/build.
Expected behavior
Macro expansion should be accepted.
Environment
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: x86_64-apple-macosx14.0
Additional information
No response
The text was updated successfully, but these errors were encountered: