modify test to show problem with %extend+overload
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6295 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c48d9ff200
commit
ed7f9ea925
2 changed files with 24 additions and 4 deletions
|
|
@ -5,24 +5,34 @@
|
|||
// Before the class
|
||||
|
||||
%extend Foo {
|
||||
Foo() { return new Foo(); }
|
||||
Foo(int a) { return new Foo(); }
|
||||
~Foo() { delete self;}
|
||||
int spam(int x) { return x; }
|
||||
};
|
||||
|
||||
%inline %{
|
||||
class Foo { };
|
||||
class Foo {
|
||||
public:
|
||||
Foo(){}
|
||||
|
||||
int spam() { return 1; }
|
||||
int spam(const char* c) { return 2; }
|
||||
};
|
||||
%}
|
||||
|
||||
// After the class
|
||||
|
||||
%inline %{
|
||||
class Bar { };
|
||||
class Bar {
|
||||
public:
|
||||
int spam() { return 1; }
|
||||
int spam(const char* c) { return 2; }
|
||||
};
|
||||
%}
|
||||
|
||||
|
||||
%extend Bar {
|
||||
Bar() { return new Bar(); }
|
||||
~Bar() { delete self;}
|
||||
int spam(int x) { return x; }
|
||||
// int spam(int x) { return x; }
|
||||
};
|
||||
|
|
|
|||
10
SWIG/Examples/test-suite/python/extend_placement_runme.py
Normal file
10
SWIG/Examples/test-suite/python/extend_placement_runme.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import extend_placement
|
||||
import types
|
||||
|
||||
foo = extend_placement.Foo(1)
|
||||
print type(foo)
|
||||
print foo.spam()
|
||||
print foo.spam("hello")
|
||||
|
||||
foo = extend_placement.Foo(1)
|
||||
print type(foo)
|
||||
Loading…
Add table
Add a link
Reference in a new issue