mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Replaced "inheritable" by "internal".
This commit is contained in:
parent
4144c63d9f
commit
c8d4ab1ca0
@ -470,7 +470,7 @@ BOOST_AUTO_TEST_CASE(illegal_override_indirect)
|
|||||||
BOOST_AUTO_TEST_CASE(illegal_override_visibility)
|
BOOST_AUTO_TEST_CASE(illegal_override_visibility)
|
||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract B { function f() inheritable {} }
|
contract B { function f() internal {} }
|
||||||
contract C is B { function f() public {} }
|
contract C is B { function f() public {} }
|
||||||
)";
|
)";
|
||||||
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
||||||
@ -706,7 +706,7 @@ BOOST_AUTO_TEST_CASE(private_state_variable)
|
|||||||
" uint64(2);\n"
|
" uint64(2);\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
"uint256 private foo;\n"
|
"uint256 private foo;\n"
|
||||||
"uint256 inheritable bar;\n"
|
"uint256 internal bar;\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
ASTPointer<SourceUnit> source;
|
ASTPointer<SourceUnit> source;
|
||||||
@ -717,7 +717,7 @@ BOOST_AUTO_TEST_CASE(private_state_variable)
|
|||||||
function = retrieveFunctionBySignature(contract, "foo()");
|
function = retrieveFunctionBySignature(contract, "foo()");
|
||||||
BOOST_CHECK_MESSAGE(function == nullptr, "Accessor function of a private variable should not exist");
|
BOOST_CHECK_MESSAGE(function == nullptr, "Accessor function of a private variable should not exist");
|
||||||
function = retrieveFunctionBySignature(contract, "bar()");
|
function = retrieveFunctionBySignature(contract, "bar()");
|
||||||
BOOST_CHECK_MESSAGE(function == nullptr, "Accessor function of an inheritable variable should not exist");
|
BOOST_CHECK_MESSAGE(function == nullptr, "Accessor function of an internal variable should not exist");
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(fallback_function)
|
BOOST_AUTO_TEST_CASE(fallback_function)
|
||||||
@ -832,11 +832,11 @@ BOOST_AUTO_TEST_CASE(access_to_default_function_visibility)
|
|||||||
BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
|
BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(access_to_inheritable_function)
|
BOOST_AUTO_TEST_CASE(access_to_internal_function)
|
||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract c {
|
contract c {
|
||||||
function f() inheritable {}
|
function f() internal {}
|
||||||
}
|
}
|
||||||
contract d {
|
contract d {
|
||||||
function g() { c(0).f(); }
|
function g() { c(0).f(); }
|
||||||
@ -856,7 +856,7 @@ BOOST_AUTO_TEST_CASE(access_to_default_state_variable_visibility)
|
|||||||
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(access_to_inheritable_state_variable)
|
BOOST_AUTO_TEST_CASE(access_to_internal_state_variable)
|
||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract c {
|
contract c {
|
||||||
|
@ -651,13 +651,13 @@ BOOST_AUTO_TEST_CASE(visibility_specifiers)
|
|||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract c {
|
contract c {
|
||||||
uint private a;
|
uint private a;
|
||||||
uint inheritable b;
|
uint internal b;
|
||||||
uint public c;
|
uint public c;
|
||||||
uint d;
|
uint d;
|
||||||
function f() {}
|
function f() {}
|
||||||
function f_priv() private {}
|
function f_priv() private {}
|
||||||
function f_public() public {}
|
function f_public() public {}
|
||||||
function f_inheritable() inheritable {}
|
function f_internal() internal {}
|
||||||
})";
|
})";
|
||||||
BOOST_CHECK_NO_THROW(parseText(text));
|
BOOST_CHECK_NO_THROW(parseText(text));
|
||||||
}
|
}
|
||||||
@ -666,7 +666,7 @@ BOOST_AUTO_TEST_CASE(multiple_visibility_specifiers)
|
|||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract c {
|
contract c {
|
||||||
uint private inheritable a;
|
uint private internal a;
|
||||||
})";
|
})";
|
||||||
BOOST_CHECK_THROW(parseText(text), ParserError);
|
BOOST_CHECK_THROW(parseText(text), ParserError);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user