solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Deep copy of arrays

Open dddejan opened this issue 6 years ago • 2 comments
trafficstars

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.

dddejan avatar Oct 10 '19 19:10 dddejan

I agree. Will add a more meaningful error message until it gets supported

hajduakos avatar Oct 11 '19 12:10 hajduakos

Meaningful error message in 60a0400

hajduakos avatar Oct 11 '19 13:10 hajduakos