Created
March 13, 2017 19:08
-
-
Save hborders/03cdfad53ad8d812458d8886d2f02bc6 to your computer and use it in GitHub Desktop.
Trying to unpack the wrong distinct values from a sum type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void badPrintExample(Example * _Nonnull example) { | |
[example switchFoo:^(ExampleBar * _Nonnull bar_) { | |
// ^ | |
// error: incompatible block pointer types sending 'void (^)(ExampleBar * _Nonnull __strong)' to parameter of type 'void (^ _Nonnull)(ExampleFoo * _Nonnull __strong)' | |
NSLog(@"Bar: %@, %@", @(bar_.b), @(bar_.c)); | |
} | |
bar:^(ExampleFoo * _Nonnull foo_) { | |
// ^ | |
// error: incompatible block pointer types sending 'void (^)(ExampleFoo * _Nonnull __strong)' to parameter of type 'void (^ _Nonnull)(ExampleBar * _Nonnull __strong)' | |
NSLog(@"Foo: %@, %@", foo_.f, foo_.g); | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment