(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:
Wim (Willem Rein) Oudshoorn 2004-04-26 07:51:35 +00:00
parent 8a4fcd7062
commit 964cb5e3b3
2 changed files with 16 additions and 6 deletions

View file

@ -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)"];
}

View file

@ -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)"];
}