There is a problem which sometimes arises when using array::append() (and a bunch of other array methods). The problem is related to the fact that these methods are generic over the items array.
The example I found is from 008_scc:
while i < |g| where |components| == state.cindex:
uint cindex = state.rindex[i]
components[cindex] = array::append(components[cindex],i)
i = i + 1
But I discovered something odd. If you substitute array::append<int> then it works fine!!
Before:
call t3686 := std$array$append$f2av1Tv1Tav1T(Type#Q4uint,Array#unbox(components$3412[cindex$3576]),Int#box(i$3015));
After
call t3690 := std$array$append$f2av1Tv1Tav1T(Type#I,Array#unbox(components$3412[cindex$3576]),Int#box(i$3015));
Hmmmmm, this has something to do with the type of i being uint.
There is a problem which sometimes arises when using
array::append()(and a bunch of other array methods). The problem is related to the fact that these methods are generic over the items array.The example I found is from
008_scc:But I discovered something odd. If you substitute
array::append<int>then it works fine!!Before:
After
Hmmmmm, this has something to do with the type of
ibeinguint.