r209906 - Objective-C. Diagnose assigning a block pointer type to

jahanian fjahanian at apple.com
Fri May 30 10:49:51 PDT 2014


It makes no sense to assign block to an object conforming to protocols.
Such objects must implement methods of those protocols which  blocks cannot.
I explicitly ruled this out. Did you see this in an actual user code? Curious to see how it is being used.

- Fariborz

On May 30, 2014, at 10:32 AM, Argyrios Kyrtzidis <kyrtzidis at apple.com> wrote:

> This is giving an error in the following case, is this correct ?
> 
> #import <Foundation/Foundation.h>
> 
> typedef void(^blk)(void);
> 
> void foo(blk b) {
> 	id<NSObject> x = b; // error: initializing 'id<NSObject>' with an expression of incompatible type 'blk' (aka 'void (^)(void)')
> }
> 




More information about the cfe-commits mailing list