This commit makes valid the following code:
// objective-c++ #define nil ((id)nullptr) ... void (^f)() = ^{}; if (f == nil) { } …
Where it would previously fail with the error invalid operands to binary expression ('void (^)()' and 'id').
Comparisons are now allowed between block types and id, id<NSCopying>, id<NSObject>, and NSObject*. No other comparisons are changed.
Do we want to allow implicit casts for all object types to block types for assignment, or only for null pointers? We definitely want to allow nil to be assigned to a block type, but I would lean slightly to requiring an implicit cast.
Ideally, I think we'd allow this but warn, because casting from an arbitrary ObjC type to a block incorrectly can cause exciting security vulnerabilities if it's done incorrectly and we should encourage people to check these casts (nil is always safe though - as long as somewhere else checks the nullability attributes).