Skip to content

Problem with array::append #132

Open

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions