diff options
author | Gav Wood <i@gavwood.com> | 2015-01-30 08:05:17 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2015-01-30 08:05:17 +0800 |
commit | 8e84dc27a7b2bca0148e33209e0f80457cfce74a (patch) | |
tree | c6d9b5be1aebe9723bfa482ac44dff8a8b3c7cad /AST.cpp | |
parent | f46df7cb92bba6f30184cc47af3aab8cda672048 (diff) | |
parent | dc6f9e3ac0370835b6db8136ba39ea7100ae93a1 (diff) | |
download | dexon-solidity-8e84dc27a7b2bca0148e33209e0f80457cfce74a.tar.gz dexon-solidity-8e84dc27a7b2bca0148e33209e0f80457cfce74a.tar.zst dexon-solidity-8e84dc27a7b2bca0148e33209e0f80457cfce74a.zip |
Merge branch 'develop' of github.com:ethereum/cpp-ethereum into develop
Conflicts:
test/SolidityEndToEndTest.cpp
test/SolidityNameAndTypeResolution.cpp
test/SolidityParser.cpp
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -285,6 +285,20 @@ void ModifierInvocation::checkTypeRequirements() BOOST_THROW_EXCEPTION(createTypeError("Invalid type for argument in modifier invocation.")); } +void EventDefinition::checkTypeRequirements() +{ + int numIndexed = 0; + for (ASTPointer<VariableDeclaration> const& var: getParameters()) + { + if (var->isIndexed()) + numIndexed++; + if (!var->getType()->canLiveOutsideStorage()) + BOOST_THROW_EXCEPTION(var->createTypeError("Type is required to live outside storage.")); + } + if (numIndexed > 3) + BOOST_THROW_EXCEPTION(createTypeError("More than 3 indexed arguments for event.")); +} + void Block::checkTypeRequirements() { for (shared_ptr<Statement> const& statement: m_statements) |