replace bad parameter names when neccessary
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7699 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a2ee7e332d
commit
2ff3dd0d4e
10 changed files with 56 additions and 15 deletions
|
|
@ -46,6 +46,7 @@
|
|||
// Functions
|
||||
%inline %{
|
||||
int foo(int a = 1, int b = 0) {return a + b; }
|
||||
|
||||
|
||||
template<typename T> T templatedfunction(T a = 1, T b = 0) { return a + b; }
|
||||
%}
|
||||
|
|
@ -72,3 +73,12 @@
|
|||
}
|
||||
|
||||
%}
|
||||
|
||||
// Functions with keywords
|
||||
%warnfilter(-314);
|
||||
%inline %{
|
||||
/* silently rename the parameter names in python */
|
||||
|
||||
int foo_kw(int from = 1, int except = 2) {return from + except; }
|
||||
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -42,3 +42,8 @@ if foo(a=1,b=2) != 3:
|
|||
if foo(b=2) != 3:
|
||||
raise RuntimeError
|
||||
|
||||
|
||||
#Funtions with keywords
|
||||
|
||||
if foo_kw(_from=2) != 4:
|
||||
raise RuntimeError
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue