diff options
author | Nicolás Venturo <nicolas.venturo@gmail.com> | 2018-07-13 06:58:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 06:58:06 +0800 |
commit | e3339a9684f69bf61f977052e4658b46f24527e2 (patch) | |
tree | dc6b109e5f862daa30705887c20af5639570813e | |
parent | 1e2a42cfe184642a18727502f79a3ee3c5e45b51 (diff) | |
download | dexon-solidity-e3339a9684f69bf61f977052e4658b46f24527e2.tar dexon-solidity-e3339a9684f69bf61f977052e4658b46f24527e2.tar.gz dexon-solidity-e3339a9684f69bf61f977052e4658b46f24527e2.tar.bz2 dexon-solidity-e3339a9684f69bf61f977052e4658b46f24527e2.tar.lz dexon-solidity-e3339a9684f69bf61f977052e4658b46f24527e2.tar.xz dexon-solidity-e3339a9684f69bf61f977052e4658b46f24527e2.tar.zst dexon-solidity-e3339a9684f69bf61f977052e4658b46f24527e2.zip |
Update docs allowed mapping key values
Functions cannot be used as mapping keys (e.g. the following contract does not compile):
```
pragma solidity ^0.4.24;
contract Foo {
mapping(function (uint) pure returns (uint) => string) a;
}
```
-rw-r--r-- | docs/types.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/types.rst b/docs/types.rst index 16445a34..1641b921 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -846,7 +846,7 @@ Mappings ======== Mapping types are declared as ``mapping(_KeyType => _ValueType)``. -Here ``_KeyType`` can be almost any type except for a mapping, a dynamically sized array, a contract, an enum and a struct. +Here ``_KeyType`` can be almost any type except for a mapping, a dynamically sized array, a contract, a function, an enum and a struct. ``_ValueType`` can actually be any type, including mappings. Mappings can be seen as `hash tables <https://en.wikipedia.org/wiki/Hash_table>`_ which are virtually initialized such that |