fix using + extend as reported by William
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8859 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
51d327f8a0
commit
e99a8a707f
3 changed files with 25 additions and 1 deletions
|
|
@ -15,3 +15,7 @@ if f.blah(3,4) != 7:
|
||||||
|
|
||||||
if f.blah(3.5,7.5) != (3.5+7.5):
|
if f.blah(3.5,7.5) != (3.5+7.5):
|
||||||
raise RuntimeError,"blah(double,double)"
|
raise RuntimeError,"blah(double,double)"
|
||||||
|
|
||||||
|
|
||||||
|
if f.duh(3) != 3:
|
||||||
|
raise RuntimeError,"duh(int)"
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ public:
|
||||||
|
|
||||||
class Bar {
|
class Bar {
|
||||||
public:
|
public:
|
||||||
|
int duh(int x) { return x; }
|
||||||
double blah(double x) { return x; }
|
double blah(double x) { return x; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -37,3 +38,9 @@ public:
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
%extend FooBar
|
||||||
|
{
|
||||||
|
using Bar::duh;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -854,7 +854,20 @@ class TypePass : private Dispatcher {
|
||||||
if (!Getattr(nn,"sym:name")) Setattr(nn,"sym:name", symname);
|
if (!Getattr(nn,"sym:name")) Setattr(nn,"sym:name", symname);
|
||||||
|
|
||||||
if (!GetFlag(nn,"feature:ignore")) {
|
if (!GetFlag(nn,"feature:ignore")) {
|
||||||
Setattr(nn,"parms",CopyParmList(Getattr(c,"parms")));
|
ParmList *parms = CopyParmList(Getattr(c,"parms"));
|
||||||
|
Setattr(nn,"parms",parms);
|
||||||
|
Delete(parms);
|
||||||
|
if (Getattr(n,"feature:extend")) {
|
||||||
|
String *ucode = NewStringf("{ self->%s(",Getattr(n,"uname"));
|
||||||
|
for (ParmList *p = parms; p;) {
|
||||||
|
StringAppend(ucode,HashGetAttr(p,k_name));
|
||||||
|
p = nextSibling(p);
|
||||||
|
if (p) StringAppend(ucode,",");
|
||||||
|
}
|
||||||
|
StringAppend(ucode,"); }");
|
||||||
|
Setattr(nn,"code",ucode);
|
||||||
|
Delete(ucode);
|
||||||
|
}
|
||||||
ParmList *throw_parm_list = Getattr(c,"throws");
|
ParmList *throw_parm_list = Getattr(c,"throws");
|
||||||
if (throw_parm_list)
|
if (throw_parm_list)
|
||||||
Setattr(nn,"throws",CopyParmList(throw_parm_list));
|
Setattr(nn,"throws",CopyParmList(throw_parm_list));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue