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:
Marcelo Matus 2006-02-10 23:58:17 +00:00
commit 082f050258
2 changed files with 43 additions and 16 deletions

View file

@ -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() {}
};
}
}
}

View file

@ -507,6 +507,10 @@ 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. check parent */
parent = Getattr(s,k_parent);
type = parent ? typedef_resolve(parent, base) : 0;
if (!type) {
/* Hmmm. Not found in my scope. It could be in an inherited scope */ /* Hmmm. Not found in my scope. It could be in an inherited scope */
inherit = Getattr(s,k_inherit); inherit = Getattr(s,k_inherit);
if (inherit) { if (inherit) {
@ -520,11 +524,8 @@ typedef_resolve(Typetab *s, String *base) {
} }
} }
} }
if (!type) {
parent = Getattr(s,k_parent);
type = parent ? typedef_resolve(parent, base) : 0;
Setmark(s,0);
} }
Setmark(s,0);
} }
} }
return type; return type;