I was checking out the features of the Swift language much as I’ve been doing with Mercury and wanted to see the use of array’s within structs. It seems the size is correctly allocated within the structure, however when it comes to assigning the array, no value is set.
@PackedAttribute
struct test{
var t:UInt64[2]
var t2:UInt64[2][2]
var b:UInt8
}
var t:test
t.t[0] = 2276
t.t2[1][1] = 94
writeLn(t.t2[1][1])
writeLn(t.t[0])
writeLn("The magic happens here. " + sizeOf(t).ToString())