Don't mark as "noassign" when a variable is immutable
I had assumed member variables could only be noassign by being "const", but I had forgotten about the `%immutable` keyword being applied via SWIG.
This commit is contained in:
parent
03dd2ec39d
commit
5a2656ab80
2 changed files with 7 additions and 4 deletions
|
|
@ -781,10 +781,7 @@ Allocate():
|
|||
Setattr(n, "cplus:staticbase", inclass);
|
||||
} else if (Cmp(Getattr(n, "kind"), "variable") == 0) {
|
||||
/* Check member variable to determine whether assignment is valid */
|
||||
if (GetFlag(n, "feature:immutable")) {
|
||||
/* Can't assign a class with an immutable member variable */
|
||||
Setattr(inclass, "allocate:noassign", "1");
|
||||
} else if (SwigType_isreference(Getattr(n, "type"))) {
|
||||
if (SwigType_isreference(Getattr(n, "type"))) {
|
||||
/* Can't assign a class with reference member data */
|
||||
Setattr(inclass, "allocate:noassign", "1");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue