diff --git a/Source/Modules/csharp.cxx b/Source/Modules/csharp.cxx index c41a212e4..89c47186e 100644 --- a/Source/Modules/csharp.cxx +++ b/Source/Modules/csharp.cxx @@ -3826,7 +3826,7 @@ public: qualified_return = SwigType_rcaststr(returntype, "c_result"); - if (!is_void && !ignored_method) { + if (!is_void && (!ignored_method || pure_virtual)) { if (!SwigType_isclass(returntype)) { if (!(SwigType_ispointer(returntype) || SwigType_isreference(returntype))) { String *construct_result = NewStringf("= SwigValueInit< %s >()", SwigType_lstr(returntype, 0)); @@ -3936,6 +3936,10 @@ public: Delete(super_call); } else { Printf(w->code, "Swig::DirectorPureVirtualException::raise(\"%s::%s\");\n", SwigType_namestr(c_classname), SwigType_namestr(name)); + if (!is_void) + Printf(w->code, "return %s;", qualified_return); + else if (!ignored_method) + Printf(w->code, "return;\n"); } if (!ignored_method) diff --git a/Source/Modules/d.cxx b/Source/Modules/d.cxx index 36216b75e..dd0fc371f 100644 --- a/Source/Modules/d.cxx +++ b/Source/Modules/d.cxx @@ -1975,7 +1975,7 @@ public: qualified_return = SwigType_rcaststr(returntype, "c_result"); - if (!is_void && !ignored_method) { + if (!is_void && (!ignored_method || pure_virtual)) { if (!SwigType_isclass(returntype)) { if (!(SwigType_ispointer(returntype) || SwigType_isreference(returntype))) { String *construct_result = NewStringf("= SwigValueInit< %s >()", SwigType_lstr(returntype, 0)); @@ -2078,6 +2078,10 @@ public: Delete(super_call); } else { Printf(w->code, "Swig::DirectorPureVirtualException::raise(\"%s::%s\");\n", SwigType_namestr(c_classname), SwigType_namestr(name)); + if (!is_void) + Printf(w->code, "return %s;", qualified_return); + else if (!ignored_method) + Printf(w->code, "return;\n"); } if (!ignored_method)