mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #3652 from ethereum/gasleft_v2
Use StaticAnalyzer to deprecate msg.gas instead of conditionally remo…
This commit is contained in:
@@ -7417,7 +7417,7 @@ BOOST_AUTO_TEST_CASE(gasleft)
|
||||
function f() public view returns (uint256 val) { return msg.gas; }
|
||||
}
|
||||
)";
|
||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
||||
CHECK_WARNING(text, "\"msg.gas\" has been deprecated in favor of \"gasleft()\"");
|
||||
|
||||
text = R"(
|
||||
contract C {
|
||||
@@ -7432,7 +7432,7 @@ BOOST_AUTO_TEST_CASE(gasleft)
|
||||
function f() public returns (uint256 val) { return msg.gas; }
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Member \"gas\" not found or not visible after argument-dependent lookup in msg");
|
||||
CHECK_ERROR(text, TypeError, "\"msg.gas\" has been deprecated in favor of \"gasleft()\"");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(gasleft_shadowing)
|
||||
|
||||
Reference in New Issue
Block a user