[swift-evolution] [Pitch] Nil struct

Anton Zhilin antonyzhilin at gmail.com
Tue Nov 8 15:12:29 CST 2016


2016-11-08 23:44 GMT+03:00 Adrian Zubarev <adrian.zubarev at devandartist.com>:

At first glance this doesn’t make any sense to me:
>
> public protocol ExpressibleByNilLiteral {
>   associatedtype NilLiteralType = Nil
>   init(nilLiteral: NilLiteralType)
> }
>
> What’s the need for associatedtype there?
>
> Shouldn’t it be just like this:
>
> public protocol ExpressibleByNilLiteral {
>
>   init(nilLiteral: Nil)
> }
>
> Probably. I just looked at ExpressibleByBooleanLiteral, and it contained
BooleanLiteralType, which should always be Bool by convention.
If someone knows, why this associatedtype is needed in
ExpressibleByBooleanLiteral, please explain.
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161109/f7900f37/attachment.html>


More information about the swift-evolution mailing list