Update of bug #41586 (project gnustep):

                  Status:                    None => Invalid                
             Open/Closed:                Analyzed => Declined               

    _______________________________________________________

Follow-up Comment #6:

To implement forwarding you should generally implement
-methodSignatureForSelector: to deal with any methods your proxy object
doesn't implement itsself.

To make things friendlier (ie cope gracefully with code where
-methodSignatureForSelector: fails) GNUstep has long (pretty much always) had
an extension (not present in the NeXT/Apple codebase) allowing it to get type
information directly from the selector, or failing that to get type
information if one (and only one) selector with that name exists.

Mostly the compiler can ensure a correctly typed selector is used, but not
always, so this feature to try to make faulty code work is not 100% reliable.
It will fail if there is no selector of the required name with type
information (eg the receiver is actually in a different process or in a
loadable bundle which hasn't been loaded yet).
It will also fail if two or more selectors with that name exist (since we have
no way of knowing which one has the correct type info).

Possibly we should remove this in a later release and force people to write
'correct' (ie Apple compatible) code.  It appears that removing it might avoid
confusion (though it might also break quite a bit of code … so I guess we'd
have to start by deprecating and printing warning messages in one release
before actually removing it)

Anyway, I hope it's clear how to add a -methodSignatureForSelector:
implementation to make your code portable/reliable.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?41586>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Bug-gnustep mailing list
Bug-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to