Skip to content

Conversation

@fabstu
Copy link
Contributor

@fabstu fabstu commented Jul 22, 2019

conflicting conformance of 'Optional<Wrapped>' to protocol 'CustomStringConvertible'; there cannot be more than one conformance, even with different conditional bounds

----------------------------------------

Failed to build the scheme "swiftgrpc": Compile /Volumes/DerivedData-ramdisk/DerivedData/aduu-swift-ccwvbioiqcuclleyjznkpzajipeb/SourcePackages/checkouts/grpc-swift/Sources/GRPCInteroperabilityTestsCLI/main.swift:
/Volumes/DerivedData-ramdisk/DerivedData/aduu-swift-ccwvbioiqcuclleyjznkpzajipeb/SourcePackages/checkouts/grpc-swift/Sources/GRPCInteroperabilityTestsCLI/main.swift:87:21: error: conflicting conformance of 'Optional<Wrapped>' to protocol 'CustomStringConvertible'; there cannot be more than one conformance, even with different conditional bounds
extension Optional: CustomStringConvertible where Wrapped: ArgumentConvertible {
                    ^
Commander.Optional<τ_0_0>:1:11: note: 'Optional<Wrapped>' declares conformance to protocol 'CustomStringConvertible' here
extension Optional : CustomStringConvertible where Wrapped : CustomStringConvertible {
          ^
/Volumes/DerivedData-ramdisk/DerivedData/aduu-swift-ccwvbioiqcuclleyjznkpzajipeb/SourcePackages/checkouts/grpc-swift/Sources/GRPCInteroperabilityTestsCLI/main.swift:96:21: warning: conformance of 'Optional<Wrapped>' to protocol 'ArgumentConvertible' was already stated in the protocol's module 'Commander'
extension Optional: ArgumentConvertible where Wrapped: ArgumentConvertible {
                    ^
/Volumes/DerivedData-ramdisk/DerivedData/aduu-swift-ccwvbioiqcuclleyjznkpzajipeb/SourcePackages/checkouts/grpc-swift/Sources/GRPCInteroperabilityTestsCLI/main.swift:97:10: note: initializer 'init(parser:)' will not be used to satisfy the conformance to 'ArgumentConvertible'
  public init(parser: ArgumentParser) throws {
         ^
Commander.Optional<τ_0_0>:1:11: note: 'Optional<Wrapped>' declares conformance to protocol 'ArgumentConvertible' here
extension Optional : Commander.ArgumentConvertible where Wrapped : Commander.ArgumentConvertible {
          ^

This conformance error comes up when using SwiftUI previews, clicking Continue/Retry to show the Preview. Removing the offending conformance makes the Preview work correctly.

I don't know whether more is required for this though.

This forum post suggests to use use wrapper types or some such to avoid this kind of issue. I don't know whether anyone would want to do that.

@MrMage
Copy link
Collaborator

MrMage commented Jul 22, 2019

@glbrntt

@glbrntt
Copy link
Collaborator

glbrntt commented Jul 22, 2019

This is coming from the CLI for the interoperability test runner which you shouldn't need here; I'm not sure why it gets built.

As it turns out we no longer use optional CLI options so we can just delete the conformance entirely.

Copy link
Collaborator

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you delete this whole section from // MARK: - Optional extensions for Commander up to (but not including) // MARK: - Command line options and "main".?

@fabstu
Copy link
Contributor Author

fabstu commented Jul 22, 2019

@glbrntt I removed the second section too, it's building now correctly in SwiftUI Preview, in swift build and with Xcode11.
With Xcode11 some tests were crashing before already, but the linux-tests now do too. Can I make it buildable without seeing the linux-tests fail, or would that be too much work / is this even related.

@glbrntt
Copy link
Collaborator

glbrntt commented Jul 23, 2019

Thanks @fabstu!

The failing test on Linux are unrelated to this change; looks like flakey tests.

@MrMage MrMage closed this Jul 23, 2019
@MrMage MrMage reopened this Jul 23, 2019
@MrMage MrMage merged commit b5a3733 into grpc:nio Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants