Am 14.06.2015 um 00:30 schrieb Michael Hackett <[email protected]>:

> I'm not sure, but from what I've read, I believe the non-underscore version 
> is only for use in Obj-C declarations (methods, properties), where the 
> double-underscore is for C declarations, including functions and variables 
> (local, global, or, I would expect, instance).
> 
> I don't know why there would be an issue with multiple levels of pointers in 
> a method declaration. Perhaps when everyone's recovered from WWDC, someone 
> else will chime in to help out. :-)

That's how I understood it as well. Basically, nullable/nonnull is invalid 
outside of a method declaration. However, it seems that it's also invalid in 
something like

- (void)foo: (nullable id*)foo;

as that gives:

error: nullability keyword 'nullable' cannot be applied to
      multi-level pointer type 'id *'

If you do

- (void)foo: (id *nullable)foo;

it gets confused:

error: expected ')'

But both work fine with __nullable. Maybe a bug?

Oh, another very nasty thing I noticed:
glibc also uses __nullable, but it takes a parameter. This means it's not 
possible to write portable code that uses __nullable :/. Maybe it would be 
wiser to just make nullable without the __ a keyword and not have __nullable 
and nullable?

--
Jonathan
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/objc-language/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to