You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since array, struct and map are value types, the following syntax does not work.
Map
Map<char,Person>map
map['a']=newPerson(1000)// override value
map['a'].balance=1001// --> map['a'] returns a copy of the struct. Changing the value will not update the map.
Struct
structPerson{int[]nums}Personp=newPerson(nums=newint[2])
p.nums[0]=1// --> p.nums returns a copy of the array. Changes on array will not be updated on struct.
Array
Person[]p=newPerson[2]
p[0]=newPerson(100)
p[0].balance=101// --> p[0] returns a copy of the struct. Changes will not take effect.
Since
array
,struct
andmap
are value types, the following syntax does not work.Map
Struct
Array
Once VM supports reference types (bazo-blockchain/bazo-vm#28), update the compiler and test them.
The text was updated successfully, but these errors were encountered: