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

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 14:48:13 PDT 2019


vsapsai marked 2 inline comments as done.
vsapsai added inline comments.


================
Comment at: clang/test/SemaObjC/block-type-safety.m:141
     genericBlock = block;
+    block = genericBlock; // expected-error {{incompatible block pointer types assigning to 'NSAllArray *(^)(id)' from 'id<Foo> (^)(id)'}}
+
----------------
This is an existing error, just added a test for it.


================
Comment at: clang/test/SemaObjC/block-type-safety.m:148-149
+    void (^genericBlockWithParam)(id<Foo>);
+    genericBlockWithParam = blockWithParam; // expected-error {{incompatible block pointer types assigning to 'void (^)(id<Foo>)' from 'void (^)(NSAllArray *)'}}
+    blockWithParam = genericBlockWithParam;
     return 0;
----------------
And this is a new error. Earlier we would emit an error on `blockWithParam = genericBlockWithParam` assignment instead.


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

https://reviews.llvm.org/D66831





More information about the cfe-commits mailing list