Conditional conformance collisions

This is definitely a known behavior. It doesn't really have anything to do with conditional conformances - you can end up with conflicts any time a library adds a conformance where it does not declare either the conforming type or the protocol. IMO a library that adds such a conformance is a bad citizen. A wrapper type or other alternative design should be used. It makes code clunkier, but ensures that users of the library do not run into this issue.

@Joe_Groff has talked about enhancements to the type system that would be able to distinguish "conflicting" conformances like this in the type system. That may alleviate this issue in the future, but for now we just need to be aware of it and take responsibility as library authors to ensure we do not contribute to problems for our users.

4 Likes