You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example in the README and main branch of the project doesn't match the code that's currently released, resulting in a rather confusing compilation error.
ArgumentParser version:1.1.4 Swift version::
swift-driver version: 1.62.14 Apple Swift version 5.7.1 (swiftlang-5.7.1.131.4 clang-1400.0.29.51)
Target: arm64-apple-macosx12.0
Checklist
If possible, I've reproduced the issue using the main branch of this package
The example in the README for Repeat explicitly uses the the new functionality for providing optional values, that was merged with #480. I grabbed the sample directly to stub in code into my repo, and got a sequence of confusing messages from Xcode about it not working, until I finally tracked down the details to the optional being a newer feature than the 1.1.4 release provided.
I wasn't sure how long until this project was thinking about releasing the next update, so I wanted to open this bug.
The error messages when you explicitly set @optional to nil are:
Type '...yourAppName...' does not conform to protocol 'Decodable'
and Referencing initializer 'init(wrappedValue:name:parsing:help:completion:)' on 'Option' requires that 'Int?' conform to 'ExpressibleByArgument'
This would be pretty quickly resolved by putting out a point release that includes that lovely optional setup that was merged after the last release, which I'd like to suggest. In the meantime, newcomers (and clueless folks like me) might take the README as reflection the currently released code and be very confused.
The text was updated successfully, but these errors were encountered:
Thanks for the issue, @heckj! I've reverted the README code sample change, so that it builds under what's in the current release. We can add it back when the next release is out, which will be 1.2.0, since it includes new API like the one that enables this improved syntax.
The example in the README and
main
branch of the project doesn't match the code that's currently released, resulting in a rather confusing compilation error.ArgumentParser version:
1.1.4
Swift version::
Checklist
main
branch of this packageThe example in the README for Repeat explicitly uses the the new functionality for providing optional values, that was merged with #480. I grabbed the sample directly to stub in code into my repo, and got a sequence of confusing messages from Xcode about it not working, until I finally tracked down the details to the optional being a newer feature than the 1.1.4 release provided.
I wasn't sure how long until this project was thinking about releasing the next update, so I wanted to open this bug.
The error messages when you explicitly set @optional to nil are:
Type '...yourAppName...' does not conform to protocol 'Decodable'
and
Referencing initializer 'init(wrappedValue:name:parsing:help:completion:)' on 'Option' requires that 'Int?' conform to 'ExpressibleByArgument'
This would be pretty quickly resolved by putting out a point release that includes that lovely optional setup that was merged after the last release, which I'd like to suggest. In the meantime, newcomers (and clueless folks like me) might take the README as reflection the currently released code and be very confused.
The text was updated successfully, but these errors were encountered: