mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
feat: allow named parameters in mapping types
Co-authored-by: Hari <webmail.hari@gmail.com> test: add parser and abi test cases docs: add example on using named parameters for mappings - Add changelog feat: update antlr grammar to allow named parameters in mappings fix: prevent conflicting mapping parameter names ref: change order of mapping initializers test: update expectations and fix build test: add more tests fix: use common error & code for conflicting params fix: issue with accessing nested mapping test: add conflicting params tests for more nested levels Update libsolidity/analysis/DeclarationTypeChecker.cpp Co-authored-by: Nikola Matić <nikola.matic@ethereum.org> fix: error reported with the same code twice test: add more tests for 3 level nested mapping Address review comments
This commit is contained in:
committed by
Nikola Matic
co-authored by
Hari
Nikola Matić
parent
1c8745c54a
commit
fa78e0f3d4
@@ -504,7 +504,7 @@ variableDeclarationTuple:
|
||||
variableDeclarationStatement: ((variableDeclaration (Assign expression)?) | (variableDeclarationTuple Assign expression)) Semicolon;
|
||||
expressionStatement: expression Semicolon;
|
||||
|
||||
mappingType: Mapping LParen key=mappingKeyType DoubleArrow value=typeName RParen;
|
||||
mappingType: Mapping LParen key=mappingKeyType name=identifier? DoubleArrow value=typeName name=identifier? RParen;
|
||||
/**
|
||||
* Only elementary types or user defined types are viable as mapping keys.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user