<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="">Hello!<div class=""><br class=""></div><div class="">I have few protocols with associated types:</div><div class=""><pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Menlo';font-size:9,0pt;" class=""><pre style="font-family: Menlo;" class=""><span style="color:#cc7832;font-weight:bold;" class="">protocol </span><span style="background-color:#344134;" class="">Remote</span> {<br class="">    <span style="color:#cc7832;font-weight:bold;" class="">associatedtype </span>Credentials<span style="color:#cc7832;" class="">: </span><span style="color:#82a094;" class="">RemoteCredentials<br class=""></span><span style="color:#82a094;" class=""><br class=""></span><span style="color:#82a094;" class="">    </span><span style="color:#cc7832;font-weight:bold;" class="">static var </span><span style="color:#c4b3a3;" class="">url</span><span style="color:#cc7832;" class="">: </span><span style="color:#b5b6e3;" class="">URI </span>{ <span style="color:#cc7832;font-weight:bold;" class="">get </span>}<br class="">    <span style="color:#cc7832;font-weight:bold;" class="">static var </span><span style="color:#c4b3a3;" class="">name</span><span style="color:#cc7832;" class="">: </span><span style="color:#b5b6e3;" class="">String </span>{ <span style="color:#cc7832;font-weight:bold;" class="">get </span>}<br class="">    <span style="color:#cc7832;font-weight:bold;" class="">static var </span><span style="color:#c4b3a3;" class="">credentials</span><span style="color:#cc7832;" class="">: </span>Credentials.Type { <span style="color:#cc7832;font-weight:bold;" class="">get </span>}<br class="">}</pre><pre style="font-family: Menlo;" class=""><span style="color:#cc7832;font-weight:bold;" class="">protocol </span><span style="background-color:#344134;" class="">RemoteAuthenticating</span> {<br class="">    <span style="color:#cc7832;font-weight:bold;" class="">associatedtype </span>Remote<span style="color:#cc7832;" class="">: </span>App.<span style="color:#82a094;" class="">Remote<br class=""></span><span style="color:#808080;" class=""><br class=""></span><span style="color:#808080;" class="">    </span><span style="color:#cc7832;font-weight:bold;" class="">func </span><span style="color:#c4b3a3;" class="">authenticate</span>(<span style="color:#c4b3a3;" class="">with </span>credentials<span style="color:#cc7832;" class="">: </span>Remote.Credentials) <span style="color:#cc7832;font-weight:bold;" class="">throws </span>-&gt; (<span style="color:#769aa5;" class="">RemoteUser</span><span style="color:#cc7832;" class="">, </span><span style="color:#82a094;" class="">ResponseRepresentable</span>?)<br class="">}</pre><div class=""><pre style="font-family: Menlo;" class=""><span style="color: rgb(204, 120, 50); font-weight: bold;" class="">protocol </span><span style="color: rgb(130, 160, 148);" class="">RemoteAuthenticationServiceBuilder </span>{<br class="">    <span style="color: rgb(204, 120, 50); font-weight: bold;" class="">associatedtype </span>Service<span style="color: rgb(204, 120, 50);" class="">: </span><span style="color: rgb(130, 160, 148);" class="">RemoteAuthenticating<br class=""></span><span style="color: rgb(130, 160, 148);" class=""><br class=""></span><span style="color: rgb(130, 160, 148);" class="">    </span><span style="color: rgb(128, 128, 128);" class="">// </span><span style="color: rgb(168, 192, 35); font-style: italic;" class="">TODO: `Service.Remote` should be constrained to `Remote` but compiler crashes<br class=""></span><span style="color: rgb(168, 192, 35); font-style: italic;" class="">    </span><span style="color: rgb(204, 120, 50); font-weight: bold;" class="">func </span><span style="color: rgb(196, 179, 163);" class="">authenticationService</span>&lt;<span style="color: rgb(118, 154, 165);" class="">Remote</span><span style="color: rgb(204, 120, 50);" class="">: </span>App.<span style="color: rgb(130, 160, 148);" class="">Remote</span>&gt;(<span style="color: rgb(196, 179, 163);" class="">for</span><span style="color: rgb(204, 120, 50);" class="">: </span><span style="color: rgb(118, 154, 165);" class="">Remote</span>.Type) -&gt; Service? <span style="color: rgb(128, 128, 128);" class="">// where Service.Remote == Remote<br class=""></span>}</pre></div></pre></div><div class="">It works fine until I uncomment the last&nbsp;<span style="font-family: Menlo;" class=""><span style="color: rgb(204, 120, 50); font-weight: bold;" class="">where&nbsp;</span></span>statement</div><div class="">If I trying to constraint Service.Remote type compiler will crash with segfault 11</div><div class="">I can guess that it's a compiler bug, but maybe I’m using generics in wrong way?</div><div class=""><br class=""></div></body></html>