aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-08-27 03:01:47 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-09-06 18:40:00 +0800
commit6ec40b3cdeca667cea2222755c6e145c72279b1d (patch)
tree090d1e61bf3d1f8807c0261ac05a441b8710587e /test
parentf687635e4743a1e12d01fb082a4f8a76a759ab48 (diff)
downloaddexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar
dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar.gz
dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar.bz2
dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar.lz
dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar.xz
dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar.zst
dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.zip
Reject constant modifier on the fallback function
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityABIJSON.cpp2
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp11
2 files changed, 11 insertions, 2 deletions
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp
index 185ba3bf..073d7d97 100644
--- a/test/libsolidity/SolidityABIJSON.cpp
+++ b/test/libsolidity/SolidityABIJSON.cpp
@@ -644,7 +644,6 @@ BOOST_AUTO_TEST_CASE(include_fallback_function)
char const* interface = R"(
[
{
- "constant" : false,
"payable": false,
"type" : "fallback"
}
@@ -696,7 +695,6 @@ BOOST_AUTO_TEST_CASE(payable_fallback_unction)
char const* interface = R"(
[
{
- "constant" : false,
"payable": true,
"type" : "fallback"
}
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index ab0f9c7b..882557fd 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -1124,6 +1124,17 @@ BOOST_AUTO_TEST_CASE(fallback_function_with_return_parameters)
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
}
+BOOST_AUTO_TEST_CASE(fallback_function_with_constant_modifier)
+{
+ char const* text = R"(
+ contract C {
+ uint x;
+ function() constant { x = 2; }
+ }
+ )";
+ BOOST_CHECK(expectError(text) == Error::Type::TypeError);
+}
+
BOOST_AUTO_TEST_CASE(fallback_function_twice)
{
char const* text = R"(