[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #41586] Invocation forwarding doesn't work on my system
From: |
Richard Frith-Macdonald |
Subject: |
[bug #41586] Invocation forwarding doesn't work on my system |
Date: |
Fri, 14 Feb 2014 12:42:28 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.71 (KHTML, like Gecko) Version/6.1 Safari/537.71 |
Update of bug #41586 (project gnustep):
Status: Need Info => None
Open/Closed: Open => Analyzed
_______________________________________________________
Follow-up Comment #4:
Actually, prompted by where you got to in gdb, I took a second look at your
testcase and realised that the problem here is that the testcase is wrong
rather than there being any bug in invocation forwarding.
Your gdb trace got *past* the code which should have done the type lookup, and
as far as some code which tries to be friendly to buggy applications and guess
what the types are intended to be … if the runtime knows about types, and
only knows of one signature for a selector, it can infer the type signature
with fairly reliably.
Anyway, to get back to your test case;
The test code is not actually attempting to forward anything, rather it's
trying to log a message when -forwardInvocation: is called, and you forgot to
implement the -methodSignatureForSelector: method in your forwarding class, so
the system won't know what type information to use. If you try out your
testcase on OSX for instance, it will raise an exception there too.
To get your test to work, I think you need to implement something like this:
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector
{
if (sel_isEqual(aSelector, @selector(name)))
{
return [Dummy instanceMethodSignatureForSelector: aSelector];
}
return [super methodSignatureForSelector: aSelector];
}
Please let me know if that fixes it for you.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?41586>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/