I have a mapping(string => Person) public map:
struct Person {
string name;
string description;
address primaryAddress;
string linkToWebsite;
string linkToPicture;
address secondaryAddress;
uint age;
}
, this struct is only made of strings, addresses and uints, but when compiling I get this error.
Internal compiler error: Accessors for mapping with dynamically-sized keys not yet implemented.
BUT,
From Solidity Features:
Strings as Mapping Keys
Strings are allowed as keys for mappings.
contract C { mapping (string => uint) counter; function inc(string _s) { counter[_s]++; } }
Any help with it?
"It is possible to mark mappings public and have Solidity create a getter. The _KeyType will become a required parameter for the getter and it will return _ValueType."
source
– obesechicken13 Mar 06 '18 at 20:18privateto solve this – Alex Mar 10 '18 at 10:19