mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Merge pull request #2882 from ethereum/events
Do not show the same error multiple times for events
This commit is contained in:
		
						commit
						4770f8f499
					
				| @ -2,6 +2,7 @@ | ||||
| 
 | ||||
| Features: | ||||
|  * Optimizer: Add new optimization step to remove unused ``JUMPDEST``s. | ||||
|  * Type Checker: Do not show the same error multiple times for events. | ||||
|  * Type Checker: Warn on using literals as tight packing parameters in ``keccak256``, ``sha3``, ``sha256`` and ``ripemd160``. | ||||
| 
 | ||||
| Bugfixes: | ||||
|  | ||||
| @ -698,15 +698,15 @@ bool TypeChecker::visit(EventDefinition const& _eventDef) | ||||
| 	{ | ||||
| 		if (var->isIndexed()) | ||||
| 			numIndexed++; | ||||
| 		if (_eventDef.isAnonymous() && numIndexed > 4) | ||||
| 			m_errorReporter.typeError(_eventDef.location(), "More than 4 indexed arguments for anonymous event."); | ||||
| 		else if (!_eventDef.isAnonymous() && numIndexed > 3) | ||||
| 			m_errorReporter.typeError(_eventDef.location(), "More than 3 indexed arguments for event."); | ||||
| 		if (!type(*var)->canLiveOutsideStorage()) | ||||
| 			m_errorReporter.typeError(var->location(), "Type is required to live outside storage."); | ||||
| 		if (!type(*var)->interfaceType(false)) | ||||
| 			m_errorReporter.typeError(var->location(), "Internal type is not allowed as event parameter type."); | ||||
| 	} | ||||
| 	if (_eventDef.isAnonymous() && numIndexed > 4) | ||||
| 		m_errorReporter.typeError(_eventDef.location(), "More than 4 indexed arguments for anonymous event."); | ||||
| 	else if (!_eventDef.isAnonymous() && numIndexed > 3) | ||||
| 		m_errorReporter.typeError(_eventDef.location(), "More than 3 indexed arguments for event."); | ||||
| 	return false; | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user