Skip to content

Commit

Permalink
update base type for arrays (#3199)
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg authored Dec 17, 2022
1 parent a15a582 commit f992492
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ Fixed-size Lists

Fixed-size lists hold a finite number of elements which belong to a specified type.

Lists can be declared with ``_name: _ValueType[_Integer]``.
Lists can be declared with ``_name: _ValueType[_Integer]``, except ``Bytes[N]``, ``String[N]`` and enums.

.. code-block:: python
Expand Down Expand Up @@ -480,7 +480,7 @@ A two dimensional list can be declared with ``_name: _ValueType[inner_size][oute
Dynamic Arrays
----------------

Dynamic arrays represent bounded arrays whose length can be modified at runtime, up to a bound specified in the type. They can be declared with ``_name: DynArray[_Type, _Integer]``, where ``_Type`` can be of value type (except ``Bytes[N]`` and ``String[N]``) or reference type (except mappings).
Dynamic arrays represent bounded arrays whose length can be modified at runtime, up to a bound specified in the type. They can be declared with ``_name: DynArray[_Type, _Integer]``, where ``_Type`` can be of value type or reference type (except mappings).

.. code-block:: python
Expand All @@ -507,7 +507,7 @@ Dynamic arrays represent bounded arrays whose length can be modified at runtime,
Attempting to access data past the runtime length of an array, ``pop()`` an empty array or ``append()`` to a full array will result in a runtime ``REVERT``. Attempting to pass an array in calldata which is larger than the array bound will result in a runtime ``REVERT``.

.. note::
To keep code easy to reason about, modifying an array while using it as an iterator it is disallowed by the language. For instance, the following usage is not allowed:
To keep code easy to reason about, modifying an array while using it as an iterator is disallowed by the language. For instance, the following usage is not allowed:

.. code-block:: python
Expand Down

0 comments on commit f992492

Please sign in to comment.