[Go] Fix member variables in base classes to handle CWRAP_NATURAL_VAR
correctly. Add a test case for the problem. Fixes #339.
This commit is contained in:
parent
c6b3088e58
commit
11d8403c3c
4 changed files with 47 additions and 3 deletions
|
|
@ -3160,15 +3160,26 @@ private:
|
|||
Setattr(var, "type", var_type);
|
||||
|
||||
SwigType *vt = Copy(var_type);
|
||||
if (SwigType_isclass(vt)) {
|
||||
SwigType_add_pointer(vt);
|
||||
}
|
||||
|
||||
int flags = Extend | SmartPointer | use_naturalvar_mode(var);
|
||||
if (isNonVirtualProtectedAccess(var)) {
|
||||
flags |= CWRAP_ALL_PROTECTED_ACCESS;
|
||||
}
|
||||
|
||||
// Copied from Swig_wrapped_member_var_type.
|
||||
if (SwigType_isclass(vt)) {
|
||||
if (flags & CWRAP_NATURAL_VAR) {
|
||||
if (CPlusPlus) {
|
||||
if (!SwigType_isconst(vt)) {
|
||||
SwigType_add_qualifier(vt, "const");
|
||||
}
|
||||
SwigType_add_reference(vt);
|
||||
}
|
||||
} else {
|
||||
SwigType_add_pointer(vt);
|
||||
}
|
||||
}
|
||||
|
||||
String *mname = Swig_name_member(getNSpace(), Getattr(var_class, "sym:name"), var_name);
|
||||
|
||||
if (is_assignable(var)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue