aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-10-04 01:30:31 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-10-06 20:48:38 +0800
commitc45e55675c57459d800391579e993975e3ad0291 (patch)
treef30d08023bd2fb39f12cebae7c75641e5386e260 /test
parent094012dbb046655ac0291f6c4632f306406c0ada (diff)
downloaddexon-solidity-c45e55675c57459d800391579e993975e3ad0291.tar.gz
dexon-solidity-c45e55675c57459d800391579e993975e3ad0291.tar.zst
dexon-solidity-c45e55675c57459d800391579e993975e3ad0291.zip
Force interface functions as external (0.5.0)
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp22
1 files changed, 22 insertions, 0 deletions
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"(