mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	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
		
			
				
	
	
		
			78 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| contract test {
 | |
|     mapping(address owner => mapping(address spender => uint value)) public allowance;
 | |
|     mapping(bytes32 => address sender) public commits;
 | |
|     mapping(bytes32 => bytes32) public something;
 | |
| }
 | |
| // ----
 | |
| //     :test
 | |
| // [
 | |
| //   {
 | |
| //     "inputs":
 | |
| //     [
 | |
| //       {
 | |
| //         "internalType": "address",
 | |
| //         "name": "owner",
 | |
| //         "type": "address"
 | |
| //       },
 | |
| //       {
 | |
| //         "internalType": "address",
 | |
| //         "name": "spender",
 | |
| //         "type": "address"
 | |
| //       }
 | |
| //     ],
 | |
| //     "name": "allowance",
 | |
| //     "outputs":
 | |
| //     [
 | |
| //       {
 | |
| //         "internalType": "uint256",
 | |
| //         "name": "value",
 | |
| //         "type": "uint256"
 | |
| //       }
 | |
| //     ],
 | |
| //     "stateMutability": "view",
 | |
| //     "type": "function"
 | |
| //   },
 | |
| //   {
 | |
| //     "inputs":
 | |
| //     [
 | |
| //       {
 | |
| //         "internalType": "bytes32",
 | |
| //         "name": "",
 | |
| //         "type": "bytes32"
 | |
| //       }
 | |
| //     ],
 | |
| //     "name": "commits",
 | |
| //     "outputs":
 | |
| //     [
 | |
| //       {
 | |
| //         "internalType": "address",
 | |
| //         "name": "sender",
 | |
| //         "type": "address"
 | |
| //       }
 | |
| //     ],
 | |
| //     "stateMutability": "view",
 | |
| //     "type": "function"
 | |
| //   },
 | |
| //   {
 | |
| //     "inputs":
 | |
| //     [
 | |
| //       {
 | |
| //         "internalType": "bytes32",
 | |
| //         "name": "",
 | |
| //         "type": "bytes32"
 | |
| //       }
 | |
| //     ],
 | |
| //     "name": "something",
 | |
| //     "outputs":
 | |
| //     [
 | |
| //       {
 | |
| //         "internalType": "bytes32",
 | |
| //         "name": "",
 | |
| //         "type": "bytes32"
 | |
| //       }
 | |
| //     ],
 | |
| //     "stateMutability": "view",
 | |
| //     "type": "function"
 | |
| //   }
 | |
| // ]
 |