|
From: sehmann <se...@gm...> - 2013-04-22 17:06:46
|
In the below code why does the second if (argc==2) block not check the type
and "goto fail:" if that check fails?
I get this cryptic error: "in method 'ConfigElementHandle_removeIndex',
argument 2 of type 'std::vector< int,std::allocator< int > >'" at runtime,
it would be preferrable to have the "Wrong number or type of arguments..."
error instead which is designed for this case.
Should I file a SWIG bug?
class ConfigElementHandle
{
public:
int removeIndex(int index);
int removeIndex(std::vector<int> indices);
};
SWIGINTERN PyObject *_wrap_ConfigElementHandle_removeIndex(PyObject *self,
PyObject *args) {
int argc;
PyObject *argv[3];
if (!(argc =
SWIG_Python_UnpackTuple(args,"ConfigElementHandle_removeIndex",0,2,argv)))
SWIG_fail;
--argc;
if (argc == 2) {
int _v = 0;
{
{
int res = SWIG_AsVal_int(argv[1], NULL);
_v = SWIG_CheckState(res);
}
}
if (!_v) goto check_1;
return _wrap_ConfigElementHandle_removeIndex__SWIG_0(self, argc, argv);
}
check_1:
if (argc == 2) {
return _wrap_ConfigElementHandle_removeIndex__SWIG_1(self, argc, argv);
}
fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of
arguments for overloaded function 'ConfigElementHandle_removeIndex'.\n"
" Possible C/C++ prototypes are:\n"
" ConfigElementHandle::removeIndex(int)\n"
" ConfigElementHandle::removeIndex(std::vector< int,std::allocator<
int > >)\n");
return 0;
}
--
View this message in context: http://swig.10945.n7.nabble.com/Python-overloaded-method-wrapping-does-not-check-types-properly-tp13213.html
Sent from the swig-user mailing list archive at Nabble.com.
|