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/SWIG@8780 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
dc6a1a432e
commit
082f050258
2 changed files with 43 additions and 16 deletions
|
|
@ -241,3 +241,29 @@ public:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%rename(FLACFile) TagLib::FLAC::File;
|
||||||
|
|
||||||
|
%inline {
|
||||||
|
namespace TagLib
|
||||||
|
{
|
||||||
|
class File {
|
||||||
|
public:
|
||||||
|
File() {}
|
||||||
|
};
|
||||||
|
class AudioProperties { };
|
||||||
|
|
||||||
|
namespace FLAC
|
||||||
|
{
|
||||||
|
class File;
|
||||||
|
class Properties : public AudioProperties {
|
||||||
|
public:
|
||||||
|
Properties(File *) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class File {
|
||||||
|
public:
|
||||||
|
File() {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -507,24 +507,25 @@ typedef_resolve(Typetab *s, String *base) {
|
||||||
resolved_scope = s;
|
resolved_scope = s;
|
||||||
Setmark(s,0);
|
Setmark(s,0);
|
||||||
} else {
|
} else {
|
||||||
/* Hmmm. Not found in my scope. It could be in an inherited scope */
|
/* Hmmm. Not found in my scope. check parent */
|
||||||
inherit = Getattr(s,k_inherit);
|
parent = Getattr(s,k_parent);
|
||||||
if (inherit) {
|
type = parent ? typedef_resolve(parent, base) : 0;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!type) {
|
if (!type) {
|
||||||
parent = Getattr(s,k_parent);
|
/* Hmmm. Not found in my scope. It could be in an inherited scope */
|
||||||
type = parent ? typedef_resolve(parent, base) : 0;
|
inherit = Getattr(s,k_inherit);
|
||||||
Setmark(s,0);
|
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;
|
return type;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue