ton-core/tact

Empty maps

Closed this issue · 1 comments

A way to clear and initialize maps is needed. You can create a map in a contract, and it will be an empty map by default, but you can't create an empty map afterward:

Error: Line 68, col 39:
  67 |         }
> 68 |         let addresses: map[Int]Address;
                                             ^
  69 | 
Expected "="

You can't create a struct and just omit map in the initialization, either.
There should be a way to create an empty map and to clear an existing one.

Added emptyMap() in 0.9.2