|
|
| Bugzilla Link |
9094 |
| Resolution |
FIXED |
| Resolved on |
Feb 04, 2011 23:57 |
| Version |
trunk |
| OS |
MacOS X |
| Attachments |
example |
| Reporter |
LLVM Bugzilla Contributor |
| CC |
@akyrtzi,@tkremenek |
Extended Description
A common pattern in classes with multiple initializers (for example NSView with -initWithFrame: and -initWithCoder:) is to put the subclass's common initialization bits into a static function. If you structure this so that the common init can fail and return nil, then you can end up with something like this:
This provokes a warning about never having assigned self before returning it, which is not true:
double-assign-self.m:28:5: warning: Returning 'self' before setting it to the result of '[(super or self) init...]'