aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-03-18 00:59:36 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-03-18 01:07:18 +0800
commit2067a00f2236980eeef812016ca923ec2cf3dbd2 (patch)
treecb65fe676c849e8d798f251db6474768f58c728c /test/libsolidity
parent5a71e4f1a7e856960d326be1743736cc04d3c238 (diff)
downloaddexon-solidity-2067a00f2236980eeef812016ca923ec2cf3dbd2.tar.gz
dexon-solidity-2067a00f2236980eeef812016ca923ec2cf3dbd2.tar.zst
dexon-solidity-2067a00f2236980eeef812016ca923ec2cf3dbd2.zip
Disallow private or internal functions in interfaces
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 2a0f342c..c002fd3e 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -5368,6 +5368,26 @@ BOOST_AUTO_TEST_CASE(interface_function_bodies)
CHECK_ERROR(text, TypeError, "Functions in interfaces cannot have an implementation");
}
+BOOST_AUTO_TEST_CASE(interface_function_internal)
+{
+ char const* text = R"(
+ interface I {
+ function f() internal;
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Functions in interfaces cannot be internal or private.");
+}
+
+BOOST_AUTO_TEST_CASE(interface_function_private)
+{
+ char const* text = R"(
+ interface I {
+ function f() private;
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Functions in interfaces cannot be internal or private.");
+}
+
BOOST_AUTO_TEST_CASE(interface_events)
{
char const* text = R"(