Files
swift-mirror/test/decl/init/default-initialization.swift
Slava Pestov 4a11785144 DI: Fix [derivedselfonly] initializers and clean up diagnostics
Designated initializers in NSManagedObject subclasses, or other
classes with @requires_stored_property_inits cannot assign to
stored properties before doing a super.init() delegation.
Assignments after are OK.

DI did the wrong thing by creating a bitmap with only one bit,
but proceeding down the usual designated initializer path.

Now, handle [derivedselfonly] more like a convenience initializer,
with no stored property access allowed prior to delegation.

Also clean up duplicated diagnostics between designated and
convenience initializers, and make convenience initializers
diagnose method calls or property accesses on self in the same
manner as designated initializers.

Fixes <rdar://problem/22110837>.

Swift SVN r32858
2015-10-24 03:55:56 +00:00

2.3 KiB