pointfreeco / swift-nonempty

🎁 A compile-time guarantee that a collection contains a value.

Home Page:https://www.pointfree.co/episodes/ep20-nonempty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don’t conform to StringProtocol

karwa opened this issue · comments

commented

Do not declare new conformances to StringProtocol. Only the String and Substring types in the standard library are valid conforming types.

https://developer.apple.com/documentation/swift/stringprotocol

commented

The conformance is here:

extension NonEmpty: StringProtocol where Collection: StringProtocol {

Thanks! We should probably document that we believe it's OK to have this conformance, as the warning you refer to appears to be obsolete: https://forums.swift.org/t/stringprotocol-do-not-declare-new-conformances/6672/3

If you have any information to the contrary that compels us to remove the conformance, we're also totally open to it! We just haven't encountered one 😄

Ended up removing this conformance. We still don't think it's necessarily a bad idea to conform, but we encountered a blocking compiler segfault while fixing another bug 😥