From c45e55675c57459d800391579e993975e3ad0291 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 3 Oct 2017 18:30:31 +0100 Subject: Force interface functions as external (0.5.0) --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 903e7308..2c720d03 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -5879,6 +5879,28 @@ BOOST_AUTO_TEST_CASE(interface_function_bodies) CHECK_ERROR(text, TypeError, "Functions in interfaces cannot have an implementation"); } +BOOST_AUTO_TEST_CASE(interface_function_external) +{ + char const* text = R"( + pragma experimental "v0.5.0"; + interface I { + function f() external; + } + )"; + success(text); +} + +BOOST_AUTO_TEST_CASE(interface_function_public) +{ + char const* text = R"( + pragma experimental "v0.5.0"; + interface I { + function f() public; + } + )"; + CHECK_ERROR(text, TypeError, "Functions in interfaces must be declared external."); +} + BOOST_AUTO_TEST_CASE(interface_function_internal) { char const* text = R"( -- cgit v1.2.3