reach-sh/reach-lang

Problem with the Reach compiler

Michele971 opened this issue · 2 comments

Problem Definition

I have encountered this error:

reachc: The compiler has encountered an internal error:

df_com switch (v113 : Data({"None": Null, "Some": Bytes(128)})) {
case None as v114 : Null/True: {
const eff = protect("Creator".interact.reportPosition(did/92, v113 ));
exit(); }
case Some as v115 : Bytes(128)/True: {
const eff = protect("Creator".interact.reportPosition(did/92, v113 ));
exit(); } }

This error indicates a problem with the Reach compiler, not your program. Please report this error, along with the pertinent program, to the Reach team as soon as possible so we can fix it.

Code

This is the code the generate the error.
In particular, the error appears if I add the else or the commented line in the snippet of code below.

const keepGoing = 
  parallelReduce(true) 
    .invariant(balance() == balance())
    .while(keepGoing)
    .api(attacherAPI.insert_z,
      (x, z, y) => { 
        y(z);
       A.only(() => interact.reportPosition(z, map_my[z])); //this line generate the error if I remove the else
        if(isSome(easy_map[z])){ 
          return false;
        }else{
       map_my[z] = fromSome(map_my[z],x);
        return true;
        }

      }
    )

NOTE: The maps is created as new Map(UInt,Bytes(128)) and the api is declared as insert_z = Fun([Bytes(128),UInt], UInt).

Thank you.

Can you send the entire program as gist.github.com link? If you are uncomfortable sharing publicly, can you please DM me on Twitter or email me at jay@reach.sh?

Done !