[swift-evolution] [Pitch] Nil struct

Pyry Jahkola pyry.jahkola at iki.fi
Tue Nov 8 14:53:41 CST 2016


If we start from this thought…

> Adrian Zubarev wrote:
> Shouldn’t it be just like this:
> public protocol ExpressibleByNilLiteral {
> 
>   init(nilLiteral: Nil)
> }

Then why not just:

    public protocol ExpressibleByIntLiteral {
      static var `nil`: Self
    }

…such that Foo.nil creates your nil value of type Foo?

— Pyry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161108/512ee306/attachment.html>


More information about the swift-evolution mailing list