From 2067a00f2236980eeef812016ca923ec2cf3dbd2 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 17 Mar 2017 16:59:36 +0000 Subject: Disallow private or internal functions in interfaces --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') 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"( -- cgit