aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2015-01-30 08:05:17 +0800
committerGav Wood <i@gavwood.com>2015-01-30 08:05:17 +0800
commit8e84dc27a7b2bca0148e33209e0f80457cfce74a (patch)
treec6d9b5be1aebe9723bfa482ac44dff8a8b3c7cad /AST.cpp
parentf46df7cb92bba6f30184cc47af3aab8cda672048 (diff)
parentdc6f9e3ac0370835b6db8136ba39ea7100ae93a1 (diff)
downloaddexon-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.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/AST.cpp b/AST.cpp
index 20c117c0..d7bfb0d3 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -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)