mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
(GSInvocationCallback): Try to find type information
if not available, also changes wording of exception when no type information is found. (Fixes #8654) git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19190 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8a4fcd7062
commit
964cb5e3b3
2 changed files with 16 additions and 6 deletions
|
@ -858,17 +858,22 @@ GSInvocationCallback (void *callback_data, va_alist args)
|
|||
}
|
||||
}
|
||||
|
||||
if (sig == nil && sel_get_type (selector) != 0)
|
||||
if (sig == nil)
|
||||
{
|
||||
selector = gs_find_best_typed_sel (selector);
|
||||
|
||||
if (sel_get_type (selector) != 0)
|
||||
{
|
||||
sig = [NSMethodSignature signatureWithObjCTypes: sel_get_type(selector)];
|
||||
}
|
||||
}
|
||||
|
||||
if (sig == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%s(%s) does not recognize %s",
|
||||
format: @"Can not determine type information for %s[%s %s]",
|
||||
GSObjCIsInstance(obj) ? "-" : "+",
|
||||
GSClassNameFromObject(obj),
|
||||
GSObjCIsInstance(obj) ? "instance" : "class",
|
||||
selector ? GSNameFromSelector(selector) : "(null)"];
|
||||
}
|
||||
|
||||
|
|
|
@ -471,17 +471,22 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
}
|
||||
}
|
||||
|
||||
if (sig == nil && sel_get_type (selector) != 0)
|
||||
if (sig == nil)
|
||||
{
|
||||
selector = gs_find_best_typed_sel (selector);
|
||||
|
||||
if (sel_get_type (selector) != 0)
|
||||
{
|
||||
sig = [NSMethodSignature signatureWithObjCTypes: sel_get_type(selector)];
|
||||
}
|
||||
}
|
||||
|
||||
if (sig == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%s(%s) does not recognize %s",
|
||||
format: @"Can not determine type information for %s[%s %s]",
|
||||
GSObjCIsInstance(obj) ? "-" : "+",
|
||||
GSClassNameFromObject(obj),
|
||||
GSObjCIsInstance(obj) ? "instance" : "class",
|
||||
selector ? GSNameFromSelector(selector) : "(null)"];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue