Hello everyone,

I have a nested struct, let's say "struct1" which contains "struct2" which
contains an int field named "field".

When I try to update the field from struct 1 directly I can't. What I mean
is if I do : "struct1 struct2 field: 4" for instance, the value in field is
not updated. Even if I inspect "struct1 struct2" and I manually set the
"field variable by doing : "self field: 4" then if I go back to my struct1
and do "self struct2 field" the value has not been updated.
So basically the only way I have to update a field in a nested structure is
to recreate the second struct entirely : "struct1 struct2: (Struct2 new
field: 4)" and now it works.

It seems odd because in C you can do "struct1.struct2.field = 4;" and it
works fine.

You can reproduce this with the NBTestNestedStructure class from
NativeBoost itself :

| myStruct |

myStruct := (NBTestNestedStructure new oneByte: (NBTestStructure1byte new
field: 1)).
Transcript show: myStruct oneByte field; cr.
myStruct oneByte field: 4.
Transcript show: myStruct oneByte field; cr.
myStruct oneByte: (NBTestStructure1byte new field: 4).
Transcript show: myStruct oneByte field; cr.

For me the Transcript shows 1 1 4 whereas in my opinion it should show 1 4
4.

So am I doing something wrong or is this some kind of a bug ?

Thanks,

Matthieu

Reply via email to