Complete the virtual:type for covariant return types

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6797 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-11-30 20:13:31 +00:00
commit bf7eb7d50d

View file

@ -114,9 +114,16 @@ class Allocate : public Dispatcher {
if (strcmp(la, ba) == 0) Setattr(c,"feature:ignore", "1");
}
} else {
// if the types are different, we record the original
// virtual base type in case some language needs it.
Setattr(c, "virtual:type", Getattr(temp, "type"));
// if the types are different, we record the base type
// those languages that need to know about covariant return types
SwigType *ty = NewString(Getattr(temp,"type"));
SwigType_push(ty,Getattr(temp,"decl"));
if (SwigType_isqualifier(ty)) {
SwigType_pop(ty);
}
Delete(SwigType_pop_function(ty));
Setattr(c, "virtual:type", ty);
}
Delete(base_decl);