[PATCH] D66831: [ObjC] Fix type checking for qualified id block parameters.

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 28 16:32:32 PDT 2019


thakis added a comment.

We're getting a bunch of errors looking like `../../AppsListViewController.m:11:37: error: incompatible block pointer types assigning to 'void (^)(__strong id<AppCellProtocol>)' from 'void (^)(AppCollectionViewCell *__strong)'` on code that looks fairly harmless to me. It looks something like this:

  @protocol AppCellProtocol <NSObject> ... @end
  @interface AppCollectionViewCell : NSObject <AppCellProtocol> ... at enderby 
  
  @interface Cell : NSObject
  @property(nonatomic, copy) void (^buttonPressed)(id<AppCellProtocol> cell);
  @end
  
  @implementation Bar
  - (void) f {
    __weak __typeof(self) weakSelf = self;
    cell.buttonPressed = ^(AppCollectionViewCell *pressedCell) {
      // ...
    };
  }
  @end

The code doesn't say `__strong` anywhere as far as I can tell; it looks like regular protocol code.

Is this expected?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66831/new/

https://reviews.llvm.org/D66831





More information about the cfe-commits mailing list