Re: Swift 2 throws from init()
Re: Swift 2 throws from init()
- Subject: Re: Swift 2 throws from init()
- From: Rick Mann <email@hidden>
- Date: Wed, 01 Jul 2015 17:39:51 -0700
> On Jul 1, 2015, at 17:04 , Greg Parker <email@hidden> wrote:
>
> Implicitly unwrapped optional is a good solution for this. The source code is no more complicated outside init, and if you get something wrong then you will get a runtime error with a useful message.
All that makes sense, although Jens's answer confuses things a bit ("According to Chris Lattner (on the swift-language mailing list) this is a known problem in the current compiler and will be fixed.").
What's the run-time penalty of using implicitly- or force-unwrapped Optionals? Does it do a check for null at each invocation, or does it crash?
--
Rick Mann
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden