-
-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Describe the bug
When compiling the package with Swift 6 (Xcode 16), there is a compiler warning/error regarding the conformance of AccessLevel to ExpressibleByArgument.
The current implementation uses:
#if compiler(>=6.0)
extension AccessLevel: @retroactive ArgumentParser.ExpressibleByArgument {}
#else
// ...
#endif
The @retroactive attribute is explicitly intended for conforming types that are defined in other modules/packages. However, AccessLevel appears to be defined within this package itself. Using @retroactive on a type owned by the defining module is incorrect and causes issues in strict Swift 6 mode.
To Reproduce
Open the project in Xcode 16.
Enable Swift 6 build mode / strict concurrency checks.
Build the package.
Observe the warning regarding the unnecessary or incorrect usage of @retroactive.
Suggested Fix
Since AccessLevel is defined within the package, the @retroactive keyword should be removed from the extension in the Swift 6 compiler block:
Swift
#if compiler(>=6.0)
extension AccessLevel: ArgumentParser.ExpressibleByArgument {}
#endif
Environment
Xcode Version: 16.0+
Swift Version: 6junestchick
Metadata
Metadata
Assignees
Labels
No labels