aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-03-16 06:12:31 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-03-18 01:06:52 +0800
commit2c4bce2d62dc8bfc752858db12c625aec6e5960f (patch)
tree2899876e56f303de00c637ce3e82f37fb004ebef /test
parent16a91ef90aaf589361e34a10dcee2181ba6cb2ed (diff)
downloaddexon-solidity-2c4bce2d62dc8bfc752858db12c625aec6e5960f.tar.gz
dexon-solidity-2c4bce2d62dc8bfc752858db12c625aec6e5960f.tar.zst
dexon-solidity-2c4bce2d62dc8bfc752858db12c625aec6e5960f.zip
Disallow enums in interfaces
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index c30bb011..f6c875f1 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -5411,6 +5411,16 @@ BOOST_AUTO_TEST_CASE(interface_variables)
CHECK_ERROR(text, TypeError, "Variables cannot be declared in interfaces");
}
+BOOST_AUTO_TEST_CASE(interface_enums)
+{
+ char const* text = R"(
+ interface I {
+ enum A { B, C }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Enumerable cannot be declared in interfaces");
+}
+
BOOST_AUTO_TEST_CASE(using_interface)
{
char const* text = R"(