solidity/test/libsolidity/syntaxTests/events/multiple_event_without_emit.sol
hrkrshnn 382c488edd Fix missing error when events are used without an emit statement.
Whenever there was a proper invocation of events, the compiler assumed that all the subsequent
invocations were proper.
2021-04-12 10:23:05 +02:00

17 lines
533 B
Solidity

contract test {
event SetFirstElem(uint indexed elem);
event SetSecondElem(uint indexed elem);
function setVal() external {
emit SetFirstElem(0);
}
function setValX() external {
// There was a missing error for this case.
// Whenever there was a proper invocation of events,
// the compiler assumed that all the subsequent invocations
// were proper.
SetFirstElem(1);
}
}
// ----
// TypeError 3132: (421-436): Event invocations have to be prefixed by "emit".