vyper icon indicating copy to clipboard operation
vyper copied to clipboard

empty() function don't work with HashMap

Open AntonD3 opened this issue 2 years ago • 0 comments

Version Information

  • vyper Version (output of vyper --version): 0.3.3
  • OS: macOS
  • Python Version (output of python --version): 2.7.16

What's your issue about?

vyper-0.3.3 error: vyper.exceptions.StructureException: HashMap can only be declared as a storage variable
  contract "tests/vyper/external/storage/mappings_array_pop_delete.vy", function "n1", line 5:24 
       4 def n1():
  ---> 5     self.a.append(empty(HashMap[uint256, uint256]))
  -------------------------------^
       6

[13936] Failed to execute script 'vyper_compile' due to unhandled exception!

Source code:

a: DynArray[HashMap[uint256, uint256], 10]

@external
def n1():
    self.a.append(empty(HashMap[uint256, uint256]))

AntonD3 avatar Aug 08 '22 16:08 AntonD3