[swift-users] How to extend a generic type with a Bool constraint?

Jens Alfke jens at mooseyard.com
Wed Aug 31 13:09:25 CDT 2016

> On Aug 31, 2016, at 10:21 AM, Dan Loewenherz <dan at lionheartsw.com> wrote:
> You'll need to specify a protocol where you're currently specifying "Bool". A generic constraint can't take a concrete type as an argument. 

OK … this should be described in the book, though. (Any doc writers listening? Or is there a procedure for requesting improvements to the book?)

I’m also bemused that (as I said) there is a boolean protocol in Swift 2.2, and a different one in master (according to swiftdoc.org <http://swiftdoc.org/>), but none in Swift 3.0 (as of Xcode 8 beta 6). Is this just a glitch that snuck into the release? Or does the Swift in Xcode predate an API freeze?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160831/79c1e694/attachment.html>

More information about the swift-users mailing list