mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove non-0.5.0 warning for emit keyword (make it mandatory)
This commit is contained in:
parent
503eb8caa5
commit
80b7d36187
@ -1712,12 +1712,7 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
|
|||||||
m_errorReporter.typeError(_functionCall.location(), "\"suicide\" has been deprecated in favour of \"selfdestruct\"");
|
m_errorReporter.typeError(_functionCall.location(), "\"suicide\" has been deprecated in favour of \"selfdestruct\"");
|
||||||
}
|
}
|
||||||
if (!m_insideEmitStatement && functionType->kind() == FunctionType::Kind::Event)
|
if (!m_insideEmitStatement && functionType->kind() == FunctionType::Kind::Event)
|
||||||
{
|
m_errorReporter.typeError(_functionCall.location(), "Event invocations have to be prefixed by \"emit\".");
|
||||||
if (m_scope->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050))
|
|
||||||
m_errorReporter.typeError(_functionCall.location(), "Event invocations have to be prefixed by \"emit\".");
|
|
||||||
else
|
|
||||||
m_errorReporter.warning(_functionCall.location(), "Invoking events without \"emit\" prefix is deprecated.");
|
|
||||||
}
|
|
||||||
|
|
||||||
TypePointers parameterTypes = functionType->parameterTypes();
|
TypePointers parameterTypes = functionType->parameterTypes();
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
contract c {
|
contract c {
|
||||||
event e(uint indexed a, bytes3 indexed s, bool indexed b);
|
event e(uint indexed a, bytes3 indexed s, bool indexed b);
|
||||||
function f() public { e(2, "abc", true); }
|
function f() public { emit e(2, "abc", true); }
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// Warning: (102-119): Invoking events without "emit" prefix is deprecated.
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
contract c {
|
contract c {
|
||||||
event e(uint a, bytes3 indexed s, bool indexed b);
|
event e(uint a, bytes3 indexed s, bool indexed b);
|
||||||
function f() public { e(2, "abc", true); }
|
function f() public { emit e(2, "abc", true); }
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// Warning: (94-111): Invoking events without "emit" prefix is deprecated.
|
|
||||||
|
@ -2,7 +2,6 @@ contract base {
|
|||||||
event e(uint a, bytes3 indexed s, bool indexed b);
|
event e(uint a, bytes3 indexed s, bool indexed b);
|
||||||
}
|
}
|
||||||
contract c is base {
|
contract c is base {
|
||||||
function f() public { e(2, "abc", true); }
|
function f() public { emit e(2, "abc", true); }
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// Warning: (120-137): Invoking events without "emit" prefix is deprecated.
|
|
||||||
|
@ -5,4 +5,4 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// Warning: (62-65): Invoking events without "emit" prefix is deprecated.
|
// TypeError: (62-65): Event invocations have to be prefixed by "emit".
|
||||||
|
@ -2,9 +2,9 @@ pragma solidity ^0.4.3;
|
|||||||
contract C {
|
contract C {
|
||||||
event SomeEvent();
|
event SomeEvent();
|
||||||
function a() public {
|
function a() public {
|
||||||
(SomeEvent(), 7);
|
(emit SomeEvent(), 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// Warning: (95-106): Invoking events without "emit" prefix is deprecated.
|
// TypeError: (95-106): Event invocations have to be prefixed by "emit".
|
||||||
// Warning: (95-106): Tuple component cannot be empty.
|
// Warning: (95-106): Tuple component cannot be empty.
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
pragma experimental "v0.5.0";
|
|
||||||
contract C {
|
|
||||||
event SomeEvent();
|
|
||||||
function a() public {
|
|
||||||
(SomeEvent(), 7);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// ----
|
|
||||||
// TypeError: (101-112): Event invocations have to be prefixed by "emit".
|
|
||||||
// TypeError: (101-112): Tuple component cannot be empty.
|
|
Loading…
Reference in New Issue
Block a user