mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disable unimplemented library functions instead
This commit is contained in:
@@ -6536,28 +6536,26 @@ BOOST_AUTO_TEST_CASE(constructor_without_implementation)
|
||||
CHECK_ERROR(text, TypeError, "Constructor must be implemented if declared.");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(calling_unimplemented_internal_functions)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract C {
|
||||
function f() internal;
|
||||
function g() { f(); }
|
||||
}
|
||||
)";
|
||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(calling_unimplemented_internal_library_functions)
|
||||
BOOST_AUTO_TEST_CASE(library_function_without_implementation)
|
||||
{
|
||||
char const* text = R"(
|
||||
library L {
|
||||
function f() internal;
|
||||
}
|
||||
contract C {
|
||||
function g() { L.f(); }
|
||||
function f();
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Inlined library function is lacking implementation.");
|
||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
||||
text = R"(
|
||||
library L {
|
||||
function f() internal;
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Internal library function must be implemented if declared.");
|
||||
text = R"(
|
||||
library L {
|
||||
function f() private;
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Internal library function must be implemented if declared.");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user