|
|
|
|
|
by zeugmasyllepsis
1921 days ago
|
|
Not without modifying the existing type. Since Interfaces rely on nominal typing, each type implementing an interface must explicitly declare that they do so. On the other hand, since Protocols are checked structurally you can declare a protocol after several types already implement it, and type checking will pass without having to modify the implementing types. |
|
But I don't think the "you can declare a protocol after several types already implement it" is any different under explicit vs implicit conformance checking.
I can just say
at any time. There's no temporal restriction on when I can do that.