diff options
author | chriseth <chris@ethereum.org> | 2018-05-04 21:02:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-04 21:02:04 +0800 |
commit | 150d226603cabd2c50b8324bd58bf06712311af9 (patch) | |
tree | 3190c59d7bc8bd9581e0289af62db8c7875cae19 /libsolidity | |
parent | 81d61ca086e8e45108b7989e7f1494d90077401e (diff) | |
parent | ffe7f224a6c9598284f100f842e3cfba58974d56 (diff) | |
download | dexon-solidity-150d226603cabd2c50b8324bd58bf06712311af9.tar.gz dexon-solidity-150d226603cabd2c50b8324bd58bf06712311af9.tar.zst dexon-solidity-150d226603cabd2c50b8324bd58bf06712311af9.zip |
Merge pull request #4063 from ethereum/emit-non-event
Show proper error when trying to emit a non-event
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 82421749..32cf1b18 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1067,6 +1067,7 @@ void TypeChecker::endVisit(EmitStatement const& _emit) { if ( _emit.eventCall().annotation().kind != FunctionCallKind::FunctionCall || + type(_emit.eventCall().expression())->category() != Type::Category::Function || dynamic_cast<FunctionType const&>(*type(_emit.eventCall().expression())).kind() != FunctionType::Kind::Event ) m_errorReporter.typeError(_emit.eventCall().expression().location(), "Expression has to be an event invocation."); |