mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Show proper error when trying to emit a non-event
This commit is contained in:
committed by
chriseth
parent
5738f93704
commit
ffe7f224a6
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user