aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-23 00:46:15 +0800
committerGitHub <noreply@github.com>2017-06-23 00:46:15 +0800
commitbffb8c404f0df22c4da7cdc2a8affcbb77377582 (patch)
tree04d461c2159cfd73c9898f3072f85b46be97b969 /test
parentce069e9c1e510ce8a1073e3d6ef0814300c5af41 (diff)
parent0f8ad1d68f60270fb22057e787ff689318c31fa9 (diff)
downloaddexon-solidity-bffb8c404f0df22c4da7cdc2a8affcbb77377582.tar.gz
dexon-solidity-bffb8c404f0df22c4da7cdc2a8affcbb77377582.tar.zst
dexon-solidity-bffb8c404f0df22c4da7cdc2a8affcbb77377582.zip
Merge pull request #2408 from federicobond/constant-parameters
Fix segmentation fault with constant function parameters
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 0b3cb481..c4b1250f 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -1597,6 +1597,16 @@ BOOST_AUTO_TEST_CASE(empty_name_input_parameter)
CHECK_SUCCESS(text);
}
+BOOST_AUTO_TEST_CASE(constant_input_parameter)
+{
+ char const* text = R"(
+ contract test {
+ function f(uint[] constant a) { }
+ }
+ )";
+ CHECK_ERROR_ALLOW_MULTI(text, TypeError, "Illegal use of \"constant\" specifier.");
+}
+
BOOST_AUTO_TEST_CASE(empty_name_return_parameter)
{
char const* text = R"(
@@ -5582,6 +5592,16 @@ BOOST_AUTO_TEST_CASE(interface_variables)
CHECK_ERROR(text, TypeError, "Variables cannot be declared in interfaces");
}
+BOOST_AUTO_TEST_CASE(interface_function_parameters)
+{
+ char const* text = R"(
+ interface I {
+ function f(uint a) returns(bool);
+ }
+ )";
+ success(text);
+}
+
BOOST_AUTO_TEST_CASE(interface_enums)
{
char const* text = R"(