better handling of using directives
This commit is contained in:
parent
d2d2bfa05f
commit
63452e9fc1
6 changed files with 100 additions and 3 deletions
|
|
@ -549,6 +549,7 @@ CPP_TEST_CASES += \
|
|||
using_directive_and_declaration_forward \
|
||||
using_extend \
|
||||
using_inherit \
|
||||
using_member \
|
||||
using_namespace \
|
||||
using_namespace_loop \
|
||||
using_pointers \
|
||||
|
|
|
|||
10
Examples/test-suite/python/using_member_runme.py
Normal file
10
Examples/test-suite/python/using_member_runme.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
from using_member import *
|
||||
|
||||
b = B()
|
||||
assert b.get(int(1)) == 10
|
||||
assert b.get(float(1)) == 20
|
||||
|
||||
bb = BB()
|
||||
assert bb.greater(int(1)) == 0
|
||||
assert bb.greater(float(1)) == 1
|
||||
assert bb.great(True) == 2
|
||||
52
Examples/test-suite/using_member.i
Normal file
52
Examples/test-suite/using_member.i
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
%module using_member;
|
||||
|
||||
%rename(greater) one::two::three::interface1::AA::great(int);
|
||||
%rename(greater) one::two::three::interface1::AA::great(float);
|
||||
|
||||
%inline %{
|
||||
namespace interface1
|
||||
{
|
||||
class A
|
||||
{
|
||||
public:
|
||||
int get(int) {return 10;}
|
||||
};
|
||||
}
|
||||
using interface1::A;
|
||||
|
||||
class B : public A
|
||||
{
|
||||
public:
|
||||
using A::get;
|
||||
int get(double) {return 20;}
|
||||
};
|
||||
|
||||
|
||||
namespace one {
|
||||
namespace two {
|
||||
namespace three {
|
||||
namespace interface1
|
||||
{
|
||||
class AA
|
||||
{
|
||||
public:
|
||||
int great(int) {return 0;}
|
||||
int great(float) {return 1;}
|
||||
};
|
||||
}
|
||||
using interface1::AA;
|
||||
}
|
||||
}
|
||||
namespace twotwo {
|
||||
namespace threetwo {
|
||||
class BB : public two::three::AA
|
||||
{
|
||||
public:
|
||||
using two::three::AA::great;
|
||||
int great(bool) {return 2;}
|
||||
int jj() {return 3;};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue