summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Matus <mmatus@acms.arizona.edu>2005-10-13 09:20:58 +0000
committerMarcelo Matus <mmatus@acms.arizona.edu>2005-10-13 09:20:58 +0000
commit13843b659c67fc909d1f718b372defeefb91efe5 (patch)
treef1868ffc4d0f4d1d4819043b3bc23302da583fcd
parentce0c34659914e848b51a85b615a4d953888359a9 (diff)
downloadswig-13843b659c67fc909d1f718b372defeefb91efe5.tar.gz
add warning for when you define a 'in' typemap but not an explicit 'typecheck' one
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7645 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r--SWIG/Source/Modules/overload.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/SWIG/Source/Modules/overload.cxx b/SWIG/Source/Modules/overload.cxx
index eede49130..459894667 100644
--- a/SWIG/Source/Modules/overload.cxx
+++ b/SWIG/Source/Modules/overload.cxx
@@ -403,6 +403,13 @@ Swig_overload_dispatch(Node *n, const String_or_char *fmt, int *maxargs) {
if (print_typecheck(f, j, pj)) {
Printf(f, "if (_v) {\n");
num_braces++;
+ }
+ if (!Getattr(pj,"tmap:in:SWIGTYPE") && Getattr(pj,"tmap:typecheck:SWIGTYPE")) {
+ /* we emit a warning if the argument defines the 'in' typemap, but not the 'typecheck' one */
+ Swig_warning(WARN_TYPEMAP_TYPECHECK_UNDEF, Getfile(ni), Getline(ni),
+ "Overloaded %s(%s) with no explicit typecheck typemap for arg %d of type '%s'\n",
+ Getattr(n,"name"),ParmList_str_defaultargs(pi),
+ j+1, SwigType_str(Getattr(pj,"type"),0));
}
Parm *pk = Getattr(pj,"tmap:in:next");
if (pk) pj = pk;