Raise error when using unimplemented internal library functions.

This commit is contained in:
Alex Beregszaszi
2017-08-08 11:58:00 +01:00
parent bea37e5682
commit 1ada48f61e
3 changed files with 40 additions and 0 deletions
@@ -6536,6 +6536,30 @@ 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)
{
char const* text = R"(
library L {
function f() internal;
}
contract C {
function g() { L.f(); }
}
)";
CHECK_ERROR(text, TypeError, "Inlined library function is lacking implementation.");
}
BOOST_AUTO_TEST_SUITE_END()
}