<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><br class=""><blockquote type="cite" class=""><div class=""><p style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px 0px 1.2em !important;" class="">In what way is this “hiding” protocol conformance? In the examples,<span class="Apple-converted-space"> </span><code style="font-size: 1em; font-family: Consolas, Inconsolata, Courier, monospace; margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; display: inline;" class="">MyClass</code><span class="Apple-converted-space"> </span>is declaring conformance to<span class="Apple-converted-space"> </span><code style="font-size: 1em; font-family: Consolas, Inconsolata, Courier, monospace; margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; display: inline;" class="">A</code><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><code style="font-size: 1em; font-family: Consolas, Inconsolata, Courier, monospace; margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; display: inline;" class="">B</code><span class="Apple-converted-space"> </span>via the<span class="Apple-converted-space"> </span><code style="font-size: 1em; font-family: Consolas, Inconsolata, Courier, monospace; margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; display: inline;" class="">Useful</code><span class="Apple-converted-space"> </span>protocol composition. Perhaps I should have made it clearer which bits are new/proposed: Only the<span class="Apple-converted-space"> </span><code style="font-size: 1em; font-family: Consolas, Inconsolata, Courier, monospace; margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; display: inline;" class="">implements</code><span class="Apple-converted-space"> </span>word is new here, the protocol composition syntax (<code style="font-size: 1em; font-family: Consolas, Inconsolata, Courier, monospace; margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; display: inline;" class="">A & B</code>) already exists.</p></div></blockquote>My fault — but imho this "sub-protocol" situation isn't that common, and it would make the proposal simpler if it starts with just forwarding:</div><div><span class="hljs-class" style="color: rgb(51, 51, 51); font-family: Consolas, Inconsolata, Courier, monospace; white-space: pre; background-color: rgb(248, 248, 248);"><span class="hljs-keyword" style="font-weight: bold;">class</span> <span class="hljs-title" style="color: rgb(68, 85, 136); font-weight: bold;">MyClass</span> : <span class="hljs-title" style="color: rgb(68, 85, 136); font-weight: bold;">A</span> </span><span style="color: rgb(51, 51, 51); font-family: Consolas, Inconsolata, Courier, monospace; white-space: pre; background-color: rgb(248, 248, 248);" class="">{
private </span><span class="hljs-keyword" style="color: rgb(51, 51, 51); font-family: Consolas, Inconsolata, Courier, monospace; white-space: pre; background-color: rgb(248, 248, 248); font-weight: bold;">let</span><span style="color: rgb(51, 51, 51); font-family: Consolas, Inconsolata, Courier, monospace; white-space: pre; background-color: rgb(248, 248, 248);" class=""> a = </span><span class="hljs-type" style="font-family: Consolas, Inconsolata, Courier, monospace; white-space: pre; background-color: rgb(248, 248, 248); color: rgb(68, 85, 136); font-weight: bold;">ImplementsA</span><span style="color: rgb(51, 51, 51); font-family: Consolas, Inconsolata, Courier, monospace; white-space: pre; background-color: rgb(248, 248, 248);" class="">() implements </span><span class="hljs-type" style="font-family: Consolas, Inconsolata, Courier, monospace; white-space: pre; background-color: rgb(248, 248, 248); color: rgb(68, 85, 136); font-weight: bold;">A</span><span style="color: rgb(51, 51, 51); font-family: Consolas, Inconsolata, Courier, monospace; white-space: pre; background-color: rgb(248, 248, 248);" class="">
</span></div><div class=""><span class="hljs-type" style="font-family: Consolas, Inconsolata, Courier, monospace; white-space: pre; background-color: rgb(248, 248, 248); color: rgb(68, 85, 136); font-weight: bold;">...</span></div><div><br class=""></div><div>In this case, there is (small) repetition (which imho isn't that bad — but Kotlin has a nicer syntax for it).</div></body></html>