Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support __nullable arguments in Objective-C blocks #4

Closed
rist opened this issue Jun 11, 2015 · 8 comments
Closed

Support __nullable arguments in Objective-C blocks #4

rist opened this issue Jun 11, 2015 · 8 comments
Assignees

Comments

@rist
Copy link

rist commented Jun 11, 2015

When compiling my project I get lots of errors like these:

In file included from /Users/../SomeClass.m:12:
/Users/../SomeOtherClass.h:32:55: error: expected ')'
- (void)someMethod:(void (^)(NSError* __nullable error))block;
                                                      ^
/Users/../SomeOtherClass.h:32:34: note: to match this '('
- (void)someMethod:(void (^)(NSError* __nullable error))block;

See https://developer.apple.com/swift/blog/?id=25 for more about the __nullable

@martinoluca
Copy link
Contributor

Thanks @rist for reporting this issue!
We are currently investigating it, the problem should be fixed soon.

@irpap irpap assigned irpap and martinoluca and unassigned irpap Jun 15, 2015
@loufranco
Copy link

Also getting this in @property attributes and return types, like:

warning: unknown warning option '-Wno-nullable-to-nonnull-conversion'; did you mean '-Wno-non-literal-null-conversion'? [-Wunknown-warning-option]
@property (nonatomic, copy, nullable) NSString *s;
                            ^
error: expected ')'
- (UIViewController * __nullable)XXVC;
                      ^
note: to match this '('
- (UIViewController * __nullable) XXVC;
  ^

@sk-
Copy link

sk- commented Jun 18, 2015

Note also that within method declarations the nullable is not expected and thus infer fails as with an expected type error.

In file included from AppNavigation.m:9:
AppNavigation.h:19:4: error: expected a type
+ (nullable UIViewController *)getTopViewController;
   ^
AppNavigation.h:20:4: error: expected a type
+ (nullable ViewController *)getChatViewIfTopViewController; // Get any ViewController on Top
   ^
AppNavigation.h:21:4: error: expected a type
+ (nullable ViewController *)getViewController;      // Get the ViewController with Bot
   ^
3 errors generated.
Command /Downloads/infer-osx-v0.1.1/infer/infer/bin/../lib/capture/clang failed with exit code 1

@matt-oakes
Copy link

Yep, hitting the same issues with properties and method declarations.

@jvillard
Copy link
Contributor

We believe the issue has been fixed in master (e17308f). The fix will make it into the next release of Infer later this week.

@matt-oakes
Copy link

I compiled from master and this now works as expected. Thanks!

@altyus
Copy link

altyus commented Jun 23, 2015

I'm seeing the same issue for nonnull. Not sure if the fix in e17308f addresses?

@jvillard
Copy link
Contributor

@altyus: yes, the patched version of clang we use now supports __nullable, __nonnull and __null_unspecified.

jvillard pushed a commit to jvillard/infer that referenced this issue Oct 27, 2021
…ty_workflow

Xi liu ds/sarif emit empty workflow
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

8 participants