Closed fappelman closed 4 years ago
Would you mind seeing if this is reproducible using a Swift 5.2 toolchain? This may be a resolved issue with the way CodingKeys are automatically generated by the compiler.
If you can’t upgrade to Swift 5.2, I believe some workarounds are to de-nest your command types or to manually define the CodingKeys
enumerations for your nested command types.
I can confirm that this is solved with Swift 5.2
Glad to hear it! Given that, and the workarounds, this isn't something we'll try to address within the library.
I have completed an application that compiles and works. When I compile for release I get linker errors about
invalid redeclaration
.ArgumentParser version: 0.0.2 Swift version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15) Target: x86_64-apple-darwin19.3.0
Checklist
master
branch of this packageSteps to Reproduce
The code needs to be spread over two files:
main.swift
:File2.swift
:This code compiles as expected using:
But then when the application is ready for distribution:
The error seems to occur during linking.
Expected behavior
I expect that the code can be compiled with
-c release
without an error.Actual behavior
The code does not compile. It provides an error which only shows when
-c release
is used and not in normal (debug) mode.