modify test to show problem with %extend+overload
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6295 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
fc489a59de
commit
f4b9b5cd02
2 changed files with 24 additions and 4 deletions
|
|
@ -5,24 +5,34 @@
|
||||||
// Before the class
|
// Before the class
|
||||||
|
|
||||||
%extend Foo {
|
%extend Foo {
|
||||||
Foo() { return new Foo(); }
|
Foo(int a) { return new Foo(); }
|
||||||
~Foo() { delete self;}
|
~Foo() { delete self;}
|
||||||
int spam(int x) { return x; }
|
int spam(int x) { return x; }
|
||||||
};
|
};
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
class Foo { };
|
class Foo {
|
||||||
|
public:
|
||||||
|
Foo(){}
|
||||||
|
|
||||||
|
int spam() { return 1; }
|
||||||
|
int spam(const char* c) { return 2; }
|
||||||
|
};
|
||||||
%}
|
%}
|
||||||
|
|
||||||
// After the class
|
// After the class
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
class Bar { };
|
class Bar {
|
||||||
|
public:
|
||||||
|
int spam() { return 1; }
|
||||||
|
int spam(const char* c) { return 2; }
|
||||||
|
};
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
%extend Bar {
|
%extend Bar {
|
||||||
Bar() { return new Bar(); }
|
Bar() { return new Bar(); }
|
||||||
~Bar() { delete self;}
|
~Bar() { delete self;}
|
||||||
int spam(int x) { return x; }
|
// int spam(int x) { return x; }
|
||||||
};
|
};
|
||||||
|
|
|
||||||
10
Examples/test-suite/python/extend_placement_runme.py
Normal file
10
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