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
|
||||
|
||||
%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; }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue