Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type checking for qualified id block parameters. #197

Closed
wants to merge 1 commit into from

Conversation

chatwyn
Copy link

@chatwyn chatwyn commented Mar 30, 2020

Hi:
we're in the process of testing with Clang 10 and noticed a behavior change caused by this commit.

Consider the following piece of code:

@protocol P
@end

@protocol Q
@end

@interface I <P,Q>
@end

void a() {
    void (^genericBlockWithParam)(id <P>);
    void (^blockWithParam)(I *);
    blockWithParam = genericBlockWithParam;
    genericBlockWithParam = blockWithParam;
}

when I use clang 9, it will be below error

incompatible block pointer types assigning to 'void (^__strong)(I *__strong)' from 'void (^__strong)(__strong id<P>)'
    blockWithParam = genericBlockWithParam;
                   ^ ~~~~~~~~~~~~~~~~~~~~~

but in clang 10, the error is that

incompatible block pointer types assigning to 'void (^__strong)(__strong id<P>)' from 'void (^__strong)(I *__strong)'
     genericBlockWithParam = blockWithParam;
                    ^ ~~~~~~~~~~~~~~~~~~~~~

I think clang 9 is reasonable.

@repo-lockdown
Copy link

repo-lockdown bot commented Mar 30, 2020

This repository does not accept pull requests. Please follow http://llvm.org/docs/Contributing.html#how-to-submit-a-patch for contribution to LLVM.

@repo-lockdown repo-lockdown bot closed this Mar 30, 2020
@repo-lockdown repo-lockdown bot locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant