remove old patch for features + def arg, but save the ignore/rename part. Now everything seems to be working.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6668 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
162bdd283d
commit
9d3cce855e
3 changed files with 47 additions and 32 deletions
|
|
@ -74,7 +74,9 @@
|
|||
|
||||
// Rename a class member
|
||||
%rename(bar2) Foo::bar;
|
||||
%rename(newname) Foo::oldname;
|
||||
%rename(newname) Foo::oldname(int x);
|
||||
%ignore Foo::Foo(int x, int y = 0, int z = 0);
|
||||
|
||||
%inline %{
|
||||
|
||||
// Define a class
|
||||
|
|
@ -83,6 +85,10 @@
|
|||
static int bar;
|
||||
static int spam;
|
||||
|
||||
Foo(){}
|
||||
|
||||
Foo(int x, int y = 0, int z = 0){}
|
||||
|
||||
// Use a renamed member as a default argument. SWIG has to resolve
|
||||
// bar to Foo::bar and not Foo::spam. SWIG-1.3.11 got this wrong.
|
||||
// (Different default parameter wrapping in SWIG-1.3.23 ensures SWIG doesn't have to resolve these symbols).
|
||||
|
|
|
|||
|
|
@ -14,4 +14,30 @@ if default_args.cfunc3(1) != 4:
|
|||
raise RuntimeError
|
||||
|
||||
|
||||
f = default_args.Foo()
|
||||
|
||||
f.newname()
|
||||
f.newname(1)
|
||||
|
||||
|
||||
try:
|
||||
f = default_args.Foo(1)
|
||||
error = 1
|
||||
except:
|
||||
error = 0
|
||||
if error: raise RuntimeError,"ignore is not working"
|
||||
|
||||
try:
|
||||
f = default_args.Foo(1,2)
|
||||
error = 1
|
||||
except:
|
||||
error = 0
|
||||
if error: raise RuntimeError,"ignore is not working"
|
||||
|
||||
try:
|
||||
f = default_args.Foo(1,2,3)
|
||||
error = 1
|
||||
except:
|
||||
error = 0
|
||||
if error: raise RuntimeError,"ignore is not working"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue