[swift-users] Implicitly type conversion ?

Jens Alfke jens at mooseyard.com
Thu Aug 18 16:38:25 CDT 2016


> On Aug 18, 2016, at 12:54 PM, Adel Zhang <adelzhang at qq.com> wrote:
> 
> Any other situation when implicit type casting works?  It would be better if there is a reference or link.

From the Swift Programming Language book, the section “Optional Type”:

The type Optional<Wrapped> is an enumeration with two cases, none and some(Wrapped), which are used to represent values that may or may not be present. Any type can be explicitly declared to be (or implicitly converted to) an optional type. If you don’t provide an initial value when you declare an optional variable or property, its value automatically defaults to nil.

—Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160818/66f225d6/attachment.html>


More information about the swift-users mailing list