Skip to content

Problem with array::append #132

Description

@DavePearce

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions