Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Only assigning to a __block variable in one of the blocks. I wish this was an error.
#import "Example.h" //
- (void)missingAssignment {
Example * _Nonnull fooExample = [[ExampleFoo alloc] initWithF:@"foo"
NSNumber * _Nonnull __block number;
[fooExample switchFoo:^(ExampleFoo * _Nonnull foo_) {
number = @(foo_.f.length + foo_.g.length);
bar:^(ExampleBar * _Nonnull bar_) {
// should be:
// number = @(bar_.b.length + bar.c.length);
@(bar_.b.length + bar.c.length);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.