@Concurrent 1.0.0 — Initial Release 🎉
A Swift macro that automatically applies @concurrent to all async methods in a type.
Features
@Concurrentmember-attribute macro — attach it to aclass,struct, orenumand everyasyncmethod (includingasync throws) is annotated with@concurrentautomatically.- Smart skipping — non-async methods,
nonisolatedmethods, and stored properties are left untouched. - Compile-time diagnostics
- Error (with fix-it) when
@Concurrentis applied to anactor, since actor methods are isolated to the actor. - Warning (with fix-it) when a method already has an explicit
@concurrentannotation.
- Error (with fix-it) when
Requirements
- Swift 6.2+ (built on swift-syntax 604)
- macOS 10.15+ / iOS 13+ / tvOS 13+ / watchOS 6+ / macCatalyst 13+ / visionOS 1+
Installation
dependencies: [
.package(url: "https://github.com/EngOmarElsayed/swift-concurrent-macro.git", from: "1.0.0")
]Usage
import ConcurrentMacro
@Concurrent
class Service {
func fetch() async { } // expands to @concurrent func fetch() async
func compute() -> Int { 0 } // untouched
}