[swift-evolution] Would having "MyType.Protocol" to indicate a type's protocols mess anything up?

Daryle Walker darylew at mac.com
Fri Jun 30 20:48:11 CDT 2017


> On Jun 30, 2017, at 9:26 PM, Robert Bennett <rltbennett at icloud.com> wrote:
> 
> I’m not at a computer to test this, but would this work:
> 
> typealias T = P1 & P2
> extension C: T {}
> 
> Now T is C.Protocol

Is C supposed to be a type or a protocol? I’m guessing a protocol since I don’t think “C.Protocol” is currently legal for a type. In either case, T wouldn’t include protocols introduced to C in some other way.

Regardless of the answers for your example, I don’t want to “write” new protocols to C, but “read” the protocols C already has.

The “MyType.Protocol” was a suggestion that I wondered if it would complicate parsing. Alternate syntax opinions requested.

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 



More information about the swift-evolution mailing list