Somewhere, somehow, we should describe the matching done by (out) typemaps. Since typemaps are documented per language module, that probably means copy-pasting the same paragraph into every language module?
Sorry, looks like I dropped the ball on this. I think I must have intended to investigate a bit first, but I've only just done so.
It seems the bug you hit has been fixed since. Testing with SWIG 4.0.2:
$cattest.i%moduletest%typemap(out)char*getbytestring1{...// will be applied CASE1}%typemap(out)char*Foo::getbytestring2{...// not matched CASE2}classFoo{public:%typemap(out)char*Foo::getbytestring3{...// not matched CASE3}%typemap(out)char*getbytestring4{...// not matched CASE4}char*getbytestring1(void);char*getbytestring2(void);char*getbytestring3(void);char*getbytestring4(void);};$swig-c++-pythontest.i$grep'wrap_Foo_getbytestring.(\|CASE'test_wrap.cxxSWIGINTERNPyObject*_wrap_Foo_getbytestring1(PyObject*SWIGUNUSEDPARM(self),PyObject*args){...// will be applied CASE1SWIGINTERNPyObject*_wrap_Foo_getbytestring2(PyObject*SWIGUNUSEDPARM(self),PyObject*args){...// not matched CASE2SWIGINTERNPyObject*_wrap_Foo_getbytestring3(PyObject*SWIGUNUSEDPARM(self),PyObject*args){...// not matched CASE3SWIGINTERNPyObject*_wrap_Foo_getbytestring4(PyObject*SWIGUNUSEDPARM(self),PyObject*args){...// not matched CASE4
So all the typemaps have matched and been applied to the correct methods.
The first hunk is no longer useful, but I've pushed a slightly tweaked version of the last hunk:
(I've noted the name is qualified with the class name since it now reliably seems to be; also corrected "a argument" to "an argument" which was wrong in the existing text.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1948099.patch (mentions limitations, too)
Logged In: YES
user_id=7446
Originator: YES
File Added: 1948099.patch
Logged In: YES
user_id=14972
Originator: NO
Is it deliberate that out typemaps don't allow qualifying with a classname? If that's a bug, we should fix it rather than document the misbehaviour.
Logged In: YES
user_id=7446
Originator: YES
Unfortunately, that's a bit above my pay grade..
Can you commit the docs fix now and leave the bug open for the bugfix?
Sorry, looks like I dropped the ball on this. I think I must have intended to investigate a bit first, but I've only just done so.
It seems the bug you hit has been fixed since. Testing with SWIG 4.0.2:
So all the typemaps have matched and been applied to the correct methods.
The first hunk is no longer useful, but I've pushed a slightly tweaked version of the last hunk:
(I've noted the name is qualified with the class name since it now reliably seems to be; also corrected "a argument" to "an argument" which was wrong in the existing text.)