<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">2016-11-08 23:44 GMT+03:00 Adrian Zubarev &lt;<a href="mailto:adrian.zubarev@devandartist.com" target="_blank">adrian.zubarev@devandartist.com</a>&gt;:</p>
<p style="margin:0px 0px 1.2em!important"></p><div class="markdown-here-exclude"><p></p><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div class="gmail-m_-4528455501304071060bloop_markdown"><p>At first glance this doesn’t make any sense to me:</p><span class="gmail-">

<pre><code class="gmail-m_-4528455501304071060swift">public protocol ExpressibleByNilLiteral {
  associatedtype NilLiteralType = Nil
  init(nilLiteral: NilLiteralType)
}
</code></pre>

</span><p>What’s the need for <code>associatedtype</code> there?</p>

<p>Shouldn’t it be just like this:</p>

<pre><code class="gmail-m_-4528455501304071060swift">public protocol ExpressibleByNilLiteral {

  init(nilLiteral: Nil)
}</code></pre></div><div class="gmail-m_-4528455501304071060bloop_markdown"><p></p></div></div></blockquote><p></p></div><p style="margin:0px 0px 1.2em!important"></p>
<p style="margin:0px 0px 1.2em!important">Probably. I just looked at <code style="font-size:0.85em;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-radius:3px;display:inline">ExpressibleByBooleanLiteral</code>, and it contained <code style="font-size:0.85em;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-radius:3px;display:inline">BooleanLiteralType</code>, which should always be <code style="font-size:0.85em;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-radius:3px;display:inline">Bool</code> by convention.<br>If someone knows, why this <code style="font-size:0.85em;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-radius:3px;display:inline">associatedtype</code> is needed in <code style="font-size:0.85em;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-radius:3px;display:inline">ExpressibleByBooleanLiteral</code>, please explain.</p>
<div title="MDH:PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj4yMDE2LTEx
LTA4IDIzOjQ0IEdNVCswMzowMCBBZHJpYW4gWnViYXJldiA8c3BhbiBkaXI9Imx0ciI+Jmx0Ozxh
IGhyZWY9Im1haWx0bzphZHJpYW4uenViYXJldkBkZXZhbmRhcnRpc3QuY29tIiB0YXJnZXQ9Il9i
bGFuayI+YWRyaWFuLnp1YmFyZXZAZGV2YW5kYXJ0aXN0LmNvbTwvYT4mZ3Q7PC9zcGFuPjo8YnI+
PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOiAwcHggMHB4IDBw
eCAwLjhleDsgYm9yZGVyLWxlZnQ6IDFweCBzb2xpZCByZ2IoMjA0LCAyMDQsIDIwNCk7IHBhZGRp
bmctbGVmdDogMWV4OyI+PGRpdiBzdHlsZT0id29yZC13cmFwOiBicmVhay13b3JkOyI+PGRpdiBj
bGFzcz0iZ21haWwtbV8tNDUyODQ1NTUwMTMwNDA3MTA2MGJsb29wX21hcmtkb3duIj48cD5BdCBm
aXJzdCBnbGFuY2UgdGhpcyBkb2VzbuKAmXQgbWFrZSBhbnkgc2Vuc2UgdG8gbWU6PC9wPjxzcGFu
IGNsYXNzPSJnbWFpbC0iPgoKPHByZT48Y29kZSBjbGFzcz0iZ21haWwtbV8tNDUyODQ1NTUwMTMw
NDA3MTA2MHN3aWZ0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