[cfe-dev] Should ObjCMethodDecl::getCanonicalDecl search superclass?

Fariborz Jahanian fjahanian at apple.com
Wed Oct 14 08:50:18 PDT 2009


On Oct 13, 2009, at 9:28 PM, Kevin Cathey wrote:

> Should the getCanonicalDecl method on ObjCMethodDecl also search its  
> superclasses? For example, if I have the following:
>
> @interface MyBaseClass <MyProtocol> {
> }
> - (void)method1;
> @end
>
> @interface MyClass : MyBaseClass {
> }
> - (void)method2:(id)argument;
> @end
>
> @implementation MyClass
> - (void)method1 {
> }
>
> - (void)method2:(id)argument {
> }
> @end
>
> I would expect that in the implementation of MyClass, that the  
> canonical decl for both methods 1 and 2 should be their definitions  
> in MyClass and MyBaseClass. Currently, only method2 resolves to the  
> declaration. method1 returns itself.

In this case you are implementing a new [MyClass method1] class which  
has no relationship to [MyBaseClass method1].
You need to provide implementation of [MyBaseClass method1] when  
@implementing MyBaseClass.

- Fariborz

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091014/6c866711/attachment.html>


More information about the cfe-dev mailing list