Re: Swift 2 throws from init()
Re: Swift 2 throws from init()
- Subject: Re: Swift 2 throws from init()
- From: Jens Alfke <email@hidden>
- Date: Wed, 01 Jul 2015 17:29:01 -0700
> On Jul 1, 2015, at 4:49 PM, Rick Mann <email@hidden> wrote:
>
> I'm trying to define a Swift wrapper around CGContext. I want to assert that a Context object, if successfully initialized, will always have a valid CGContextRef property. Since at least one of my initializers can fail, I set it up as "throws".
>
> After getting the actual init code to compile, I've run into this: "error: all stored properties of a class instance must be initialized before throwing from an initializer"
According to Chris Lattner (on the swift-language mailing list) this is a known problem in the current compiler and will be fixed.
—Jens
_______________________________________________
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