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:
Marcelo Matus 2004-10-03 19:51:11 +00:00
commit ed7f9ea925
2 changed files with 24 additions and 4 deletions

View file

@ -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; }
};

View 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)