diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-10-10 18:21:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-10 18:21:08 +0800 |
commit | c35496bf4ab0143f2060f30e58febbbc77b0e383 (patch) | |
tree | 22156a3640c88636960c638e66f5e440ab9bb5ac /test | |
parent | 9ee619c9bba5cdbabfa9d587a0c726d1eaae9be9 (diff) | |
parent | c45e55675c57459d800391579e993975e3ad0291 (diff) | |
download | dexon-solidity-c35496bf4ab0143f2060f30e58febbbc77b0e383.tar.gz dexon-solidity-c35496bf4ab0143f2060f30e58febbbc77b0e383.tar.zst dexon-solidity-c35496bf4ab0143f2060f30e58febbbc77b0e383.zip |
Merge pull request #3038 from ethereum/interface-external
Force interface functions as external (0.5.0)
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 22 |
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"( |