Skip to content

Deep copy of arrays  #99

Open
Open
@dddejan

Description

@dddejan
pragma solidity >=0.5.0;

contract Test {
  struct S {
    int x;
  }
  S[] m_a;
  function test() external view {
    S[] memory a;
    a = m_a;
  }
}

Gives

solc-verify.py Test.sol --output .
Error while running verifier, details:
Parsing ./Test.sol.bpl
./Test.sol.bpl(42,85): Error: right-hand side in map store with wrong type: struct_storage_S#4_arr_type (expected: address_struct_memory_S#4_arr_type)
1 type checking errors detected in ./Test.sol.bpl

It's not clear how we support this. More meaningful error message would be good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions