Merge pull request #10431 from Jaime-Iglesias/issue-10284

[docs] Add clarification to struct initialization in previous versions
This commit is contained in:
Leonardo 2020-11-30 11:12:42 +01:00 committed by GitHub
commit 84ff925de4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -550,3 +550,8 @@ members of the local variable actually write to the state.
Of course, you can also directly access the members of the struct without Of course, you can also directly access the members of the struct without
assigning it to a local variable, as in assigning it to a local variable, as in
``campaigns[campaignID].amount = 0``. ``campaigns[campaignID].amount = 0``.
.. note::
Until Solidity 0.7.0, memory-structs containing members of storage-only types (e.g. mappings)
were allowed and assignments like ``campaigns[campaignID] = Campaign(beneficiary, goal, 0, 0)``
in the example above would work and just silently skip those members.