aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-04 20:35:06 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-08 18:58:00 +0800
commit1ada48f61e020a32c0c1f41394ded9a83d5ba57e (patch)
treecfa812e75c27bd565f922e02b1b819fe8044e962 /test
parentbea37e5682d83b11988e51a16848319a59c39dd3 (diff)
downloaddexon-solidity-1ada48f61e020a32c0c1f41394ded9a83d5ba57e.tar.gz
dexon-solidity-1ada48f61e020a32c0c1f41394ded9a83d5ba57e.tar.zst
dexon-solidity-1ada48f61e020a32c0c1f41394ded9a83d5ba57e.zip
Raise error when using unimplemented internal library functions.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index aaf1a449..ef83cc61 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -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()
}