Fix virtual conversion operators for directors

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9410 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-10-04 17:34:08 +00:00
commit f62ef6242d
5 changed files with 40 additions and 10 deletions

View file

@ -3394,12 +3394,18 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
String *qualified_name = NewStringf("%s::%s", pclassname, name);
target = Swig_method_decl(decl, qualified_name, l, 0, 0);
String *rtype = SwigType_str(type, 0);
Printf(w->def, "%s %s", rtype, target);
if (Getattr(n, "conversion_operator"))
Printf(w->def, "%s", target);
else
Printf(w->def, "%s %s", rtype, target);
Delete(qualified_name);
Delete(target);
/* header declaration */
target = Swig_method_decl(decl, name, l, 0, 1);
Printf(declaration, " virtual %s %s", rtype, target);
if (Getattr(n, "conversion_operator"))
Printf(declaration, " virtual %s", target);
else
Printf(declaration, " virtual %s %s", rtype, target);
Delete(target);
// Get any exception classes in the throws typemap