destructure_assign_struct_member.sol 454 B

123456789101112131415161718
  1. // https://github.com/hyperledger-solang/solang/issues/731
  2. contract TestContract {
  3. struct Data {
  4. bytes32 a1;
  5. bytes32 a2;
  6. }
  7. mapping(uint176 => bytes32) Hashes;
  8. constructor() {}
  9. function getdata(uint176 id, bool needHash) public view returns (Data memory g) {
  10. (g.a1, g.a2) = (Hashes[id+1], Hashes[id+2]);
  11. }
  12. }
  13. // ---- Expect: diagnostics ----
  14. // warning: 12:39-47: function parameter 'needHash' is unused