'out' or 'ref' usage in a cstype typemap in directors

'out' / 'ref' was not always stripped out in parts of the
director code generation.

Issue #1628
This commit is contained in:
William S Fulton 2019-11-26 19:32:34 +00:00
commit 6fb345feb2
5 changed files with 98 additions and 4 deletions

View file

@ -4064,11 +4064,10 @@ public:
/* Get the C# parameter type */
if ((tm = Getattr(p, "tmap:cstype"))) {
substituteClassname(pt, tm);
if (Strncmp(tm, "ref ", 4) == 0) {
Replace(tm, "ref ", "", DOH_REPLACE_FIRST);
int flags = DOH_REPLACE_FIRST | DOH_REPLACE_ID_BEGIN;
if (Replace(tm, "ref ", "", flags) || Replace(tm, "ref\t", "", flags)) {
Printf(proxy_method_types, "typeof(%s).MakeByRefType()", tm);
} else if (Strncmp(tm, "out ", 4) == 0) {
Replace(tm, "out ", "", DOH_REPLACE_FIRST);
} else if (Replace(tm, "out ", "", flags) || Replace(tm, "out\t", "", flags)) {
Printf(proxy_method_types, "typeof(%s).MakeByRefType()", tm);
} else {
Printf(proxy_method_types, "typeof(%s)", tm);