aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-09-12 17:35:42 +0800
committerGitHub <noreply@github.com>2017-09-12 17:35:42 +0800
commit4770f8f4990bb663b8c79a65f17bfe5536bb702a (patch)
treea3b4a70411438a343d23736505ed2647c38145ab
parentfabf4accd3fe5b38068ee1ef30a637ae297a00bd (diff)
parenta52e0de67c2fad02da43ef645c739632c61c923b (diff)
downloaddexon-solidity-4770f8f4990bb663b8c79a65f17bfe5536bb702a.tar.gz
dexon-solidity-4770f8f4990bb663b8c79a65f17bfe5536bb702a.tar.zst
dexon-solidity-4770f8f4990bb663b8c79a65f17bfe5536bb702a.zip
Merge pull request #2882 from ethereum/events
Do not show the same error multiple times for events
-rw-r--r--Changelog.md1
-rw-r--r--libsolidity/analysis/TypeChecker.cpp8
2 files changed, 5 insertions, 4 deletions
diff --git a/Changelog.md b/Changelog.md
index 4af4419d..f61bb560 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -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:
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index c46485d8..d2151cda 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -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;
}