Closed Coeur closed 5 months ago
Ambiguous use of 'init(name:parsing:help:completion:transform:)' when transform throws.
transform
This is a regression introduced with #477 (swift-argument-parser 1.2.0).
ArgumentParser version: main branch Swift version: swiftlang-5.11
main
public struct MyError: Error {} struct MyCommand: ParsableCommand { @Option(transform: { guard let url = URL(string: $0) else { throw MyError() } return url }) var test: URL? }
No errors.
Ambiguous use of 'init(name:parsing:help:completion:transform:)'
Workarounds:
var test: URL?
var test: URL? = nil
Ambiguous use of 'init(name:parsing:help:completion:transform:)' when
transform
throws.This is a regression introduced with #477 (swift-argument-parser 1.2.0).
ArgumentParser version:
main
branch Swift version: swiftlang-5.11Checklist
main
branch of this packageSteps to Reproduce
Expected behavior
No errors.
Actual behavior
Workarounds:
var test: URL?
withvar test: URL? = nil
transform
non-throwing