Open BelaSzombathelyi opened 8 years ago
I'm not sure why @weakify
and @strongify
would have anything to do with this.
If you use explicit __weak
and __strong
variables, do you see the same issue?
No, I can not compile it.
- (int)test
{
if (YES) {
} else {
__weak __typeof(self)weakSelf = self;
^{
__strong __typeof(weakSelf) strongSelf = weakSelf;
NSLog(@"%@",strongSelf.class);
}();
}
} // Control reaches end of non-void function
I use LLVM 7.1 with Xcode 7.3.1 (7D1014), (if it helps)
It might be the @finally
embedded within the macros. I'm not sure there's a readily apparent solution here, sorry. 😕
I found the answer. If a method contains try-catch block, compiler not warning for "Non-void function" Example:
- (int)test
{
@try {
} @catch (NSException *exception) {
}
}//No error
This bug no jump between methods, only one method deep.
- (int)a
{
[self b];
} // Control reaches end of non-void function
- (void)b
{
@try {
} @catch (NSException *exception) {
}
}
The LLVM not drop warning for this:
If I remove weakly and strongly it drop compile error.