From 88ef6e09319a1238832e645eb5117be70536f6c5 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 30 Jan 2020 08:34:07 +0000 Subject: [PATCH] Fix display of template classnames in generated R code --- Source/Modules/r.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Modules/r.cxx b/Source/Modules/r.cxx index 2ad377af1..dc284f82b 100644 --- a/Source/Modules/r.cxx +++ b/Source/Modules/r.cxx @@ -1126,8 +1126,8 @@ int R::OutputMemberReferenceMethod(String *className, int isSet, } Printf(f->code, "}\n"); - - Printf(out, "# Start of accessor method for %s\n", className); + String *classname_str = SwigType_namestr(className); + Printf(out, "# Start of accessor method for %s\n", classname_str); Printf(out, "setMethod('$%s', '_p%s', ", isSet ? "<-" : "", getRClassName(className)); @@ -1143,11 +1143,12 @@ int R::OutputMemberReferenceMethod(String *className, int isSet, Printf(out, ");\n"); } + Printf(out, "# end of accessor method for %s\n", classname_str); + + Delete(classname_str); DelWrapper(attr); DelWrapper(f); - Printf(out, "# end of accessor method for %s\n", className); - return SWIG_OK; }