|
From: | Ziemowit Laski |
Subject: | Re: [objc-improvements] Warnings when compiling GNUStep |
Date: | Thu, 4 Sep 2003 14:26:56 -0700 |
On Thursday, Sep 4, 2003, at 02:07 US/Pacific, Nicola Pero wrote:
but since Objective-C allows multiple root classes, the compiler cannot statically decide to focus on NSObject. What should we do? I see 3 choices: (1) Leave things as they are. Users will be able to suppress the above warning bycasting the receiver to the root class (in above case, '(NSObject*)').(2) Build a list of all plausible root classes (i.e., classes withoutsuperclasses), and consult all instance methods for those classes when dispatching messages to 'Class'(3) Treat messages to 'Class' the same way we treat messages to 'id',i.e., consult all class and instance methods available. This is what the compiler appears to have done until now (in its mercurial and buggy way).I've implemented 2. in my patch, and I think this is correct and consistent with the intention of the current behavior.I agree. That is what should happen. When looking up methods of a receiver of type 'Class', an instance method of a non-root class shouldnot be found (big warning!); an instance method of a root class should be found (no warning if only one is found, warning if conflicting methods arefound). I think this is correct because this is how messaging works.
Yes, I've come around on this issue also. :-) So long as the implementation is efficient (and I too now realize there's no reason why it couldn't be),
we should look among root class instance methods as a last resort. --Zem -------------------------------------------------------------- Ziemowit Laski 1 Infinite Loop, MS 301-2K Mac OS X Compiler Group Cupertino, CA USA 95014-2083 Apple Computer, Inc. +1.408.974.6229 Fax .5477
[Prev in Thread] | Current Thread | [Next in Thread] |