[PATCH] D79511: [ObjC] Add compatibility mode for type checking of qualified id block parameters.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 6 17:04:27 PDT 2020


vsapsai added inline comments.


================
Comment at: clang/test/SemaObjC/block-type-safety.m:170
+    genericBlockWithParam = blockWithParam;
+    blockWithParam = genericBlockWithParam; // expected-error {{incompatible block pointer types assigning to 'void (^)(NSAllArray *)' from 'void (^)(id<Foo>)'}}
+    return 0;
----------------
jyknight wrote:
> It seems a shame to disallow this assignment in the compatibility mode, when it ought to be allowed.
> 
> Perhaps it would be better to allow both directions for parameters when the compatibility flag is set? (That is: the compat mode flag would only cause the compiler to allow _more_ things than it otherwise should.)
> 
> 
Hmm, sounds like an interesting idea. It can make the transitioning to the new compiler version less disruptive. Need to think more if it has any undesirable consequences. So far my only objection is that it makes things less consistent. But given the current state of block type checking that argument isn't particularly compelling.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79511





More information about the cfe-commits mailing list