fix namespace issue reported by Nero, in short, types must be resolved first in the parent scope, then in the base class list
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8780 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4271ac67b1
commit
86247fd2ca
2 changed files with 43 additions and 16 deletions
|
|
@ -507,24 +507,25 @@ typedef_resolve(Typetab *s, String *base) {
|
|||
resolved_scope = s;
|
||||
Setmark(s,0);
|
||||
} else {
|
||||
/* Hmmm. Not found in my scope. It could be in an inherited scope */
|
||||
inherit = Getattr(s,k_inherit);
|
||||
if (inherit) {
|
||||
int i,len;
|
||||
len = Len(inherit);
|
||||
for (i = 0; i < len; i++) {
|
||||
type = typedef_resolve(Getitem(inherit,i), base);
|
||||
if (type) {
|
||||
Setmark(s,0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Hmmm. Not found in my scope. check parent */
|
||||
parent = Getattr(s,k_parent);
|
||||
type = parent ? typedef_resolve(parent, base) : 0;
|
||||
if (!type) {
|
||||
parent = Getattr(s,k_parent);
|
||||
type = parent ? typedef_resolve(parent, base) : 0;
|
||||
Setmark(s,0);
|
||||
/* Hmmm. Not found in my scope. It could be in an inherited scope */
|
||||
inherit = Getattr(s,k_inherit);
|
||||
if (inherit) {
|
||||
int i,len;
|
||||
len = Len(inherit);
|
||||
for (i = 0; i < len; i++) {
|
||||
type = typedef_resolve(Getitem(inherit,i), base);
|
||||
if (type) {
|
||||
Setmark(s,0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Setmark(s,0);
|
||||
}
|
||||
}
|
||||
return type;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue