From e3339a9684f69bf61f977052e4658b46f24527e2 Mon Sep 17 00:00:00 2001 From: Nicolás Venturo Date: Thu, 12 Jul 2018 19:58:06 -0300 Subject: 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; } ``` --- docs/types.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/types.rst') 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 `_ which are virtually initialized such that -- cgit