[swift-users] Extensions on Typealiased Existential Protocols
Steven Brunwasser
sbrunwasser at gmail.com
Mon Jun 19 13:44:10 CDT 2017
Is this error intentional, or a bug?
protocol A {}
protocol B {}
typealias C = A & B // valid
extension C {} // Error: Non-nominal type 'C' (aka 'A & B') cannot be
extended
extension A where Self: B {} // valid
struct Foo: C {} // valid
Since extension A where Self: B is the same as extension B where Self: A,
and C is defined as any A that also inherits from B, shouldn’t extension C be
just as valid?
This seems like it should be valid, so I filed this bug,
https://bugs.swift.org/browse/SR-5260.
- Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170619/7e2bae9f/attachment.html>
More information about the swift-users
mailing list