Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/types/reference-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ non-persistent area where function arguments are stored, and behaves mostly like
data location can also be returned from functions, but it is not possible to
allocate such types.

.. note::
Arrays and structs with ``calldata`` location declared in a function body
or as its return parameters must be assigned before being used or returned.
There are certain cases in which non-trivial control flow is used and the compiler
can't properly detect the initialization.
A common workaround in such cases is to assign the affected variable to itself before
the correct initialization takes place.

.. note::
Prior to version 0.6.9 data location for reference-type arguments was limited to
``calldata`` in external functions, ``memory`` in public functions and either
Expand Down