[cfe-dev] objc method lookup in super class implementation
steve naroff
snaroff at apple.com
Sun Mar 8 09:08:55 PDT 2009
Hi Jean-Daniel,
This patch looks good, however it doesn't handle 'super'.
snaroff% ../../../../Debug/bin/clang method-lookup-4.m
method-lookup-4.m:30:3: warning: method '-myMethod' not found (return
type defaults to 'id')
[super myMethod];
^~~~~~~~~~~~~~~~
1 diagnostic generated.
Since the patch relates to looking in super classes, it would be nice
if it handled messages to 'super' as well.
Thanks,
snaroff
On Mar 8, 2009, at 7:09 AM, Jean-Daniel Dupas wrote:
> Hello,
>
> When clang lookup a method, it searches in the class implementation
> if it is in scope, but it does not try to search in super class
> implementation that may be in the scope too.
>
> The result is that it emits "may not responds to selector" warning
> where it is obvious that the object will, as its superclass
> implement it.
>
> Here is a patch to lookup in superclasses implementations (if in
> scope), and a test case.
>
>
>
> <lookup-superimpl.patch>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list