[swift-evolution] [Pitch] Allow nested protocol declarations

David Sweeris davesweeris at mac.com
Thu Apr 28 18:43:03 CDT 2016


> On Apr 28, 2016, at 6:27 PM, Douglas Gregor via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Note that this cannot work when any enclosing type is generic, e.g.,
> 
> class MyController<T> {
>   protocol Delegate {
>     // I’ve just created a parameterized protocol!
>   }
> }
> 
> Otherwise, I don’t see any issues with the proposal, and I like that it eliminates a large number of top-level names.
> 
> 	- Doug

Is that a bad, or are you just pointing out that this proposal would implicitly add parameterized protocols to Swift? I don’t think they’re *exactly* the same as “naked” parameterized protocols, since you wouldn’t be able access a nested protocol without specifying all the container type’s generic parameters, but maybe that’s a difference that makes no difference.

- Dave Sweeris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160428/8a81704e/attachment.html>


More information about the swift-evolution mailing list