mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Definite initialization for initializers relying on a separate ivar initializer.
When we decide to emit a separate ivar initializer method (via the Objective-C entry point -.cxx_construct), we no longer initialize the ivars within the initializer. This only happens for derived classes, so teach DI about uninitialized 'self' values that require a super.init call but don't require the ivars to be initialized. Swift SVN r12240
This commit is contained in:
@@ -804,6 +804,10 @@ public:
|
||||
/// DerivedSelf designates "self" in a derived (non-root) class.
|
||||
DerivedSelf,
|
||||
|
||||
/// Designates "self" in a derived (non-root) class whose stored properties
|
||||
/// have already been initialized.
|
||||
DerivedSelfOnly,
|
||||
|
||||
/// DelegatingSelf designates "self" on a struct, enum, or class
|
||||
/// in a delegating constructor (one that calls self.init).
|
||||
DelegatingSelf,
|
||||
@@ -825,6 +829,9 @@ public:
|
||||
bool isDerivedClassSelf() const {
|
||||
return ThisKind == DerivedSelf;
|
||||
}
|
||||
bool isDerivedClassSelfOnly() const {
|
||||
return ThisKind == DerivedSelfOnly;
|
||||
}
|
||||
bool isDelegatingSelf() const {
|
||||
return ThisKind == DelegatingSelf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user