mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Three more tests for shadowing.
This commit is contained in:
parent
060d229a22
commit
eacc67c430
@ -6134,6 +6134,25 @@ BOOST_AUTO_TEST_CASE(shadowing_builtins_with_variables)
|
|||||||
CHECK_WARNING(text, "shadows a builtin symbol");
|
CHECK_WARNING(text, "shadows a builtin symbol");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(shadowing_builtins_with_storage_variables)
|
||||||
|
{
|
||||||
|
char const* text = R"(
|
||||||
|
contract C {
|
||||||
|
uint msg;
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
CHECK_WARNING(text, "shadows a builtin symbol");
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(shadowing_builtin_at_global_scope)
|
||||||
|
{
|
||||||
|
char const* text = R"(
|
||||||
|
contract msg {
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
CHECK_WARNING(text, "shadows a builtin symbol");
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(shadowing_builtins_with_parameters)
|
BOOST_AUTO_TEST_CASE(shadowing_builtins_with_parameters)
|
||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
@ -6201,6 +6220,17 @@ BOOST_AUTO_TEST_CASE(function_overload_is_not_shadowing)
|
|||||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
CHECK_SUCCESS_NO_WARNINGS(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(function_override_is_not_shadowing)
|
||||||
|
{
|
||||||
|
char const* text = R"(
|
||||||
|
contract D { function f() {} }
|
||||||
|
contract C is D {
|
||||||
|
function f(uint) {}
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
CHECK_SUCCESS_NO_WARNINGS(text);
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(callable_crash)
|
BOOST_AUTO_TEST_CASE(callable_crash)
|
||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
|
Loading…
Reference in New Issue
Block a user