Skip to content

Tuple-destructure into existing variables #136

Description

@mr-zwets

It would be clean if cashscript allowed to redefine variables in tuples, for example:

bytes variableA = 0x00;
bytes variableB = 0x00;
if(condition){
  variableA,variableB = bytesequence.split(index); 
}

Currently the workaround is

bytes variableA = 0x00;
bytes variableB = 0x00;
if(condition){
  variableA = bytesequence.split(index)[0]; 
  variableB = bytesequence.split(index)[1];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    cashc-compilerRelates to the cashc compiler

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions