aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-09-05 19:34:57 +0800
committerchriseth <c@ethdev.com>2016-09-06 03:28:28 +0800
commit1eb7ddbb09b2ff3c65b6329962229ffcc10eaf03 (patch)
treea7865a77f8f0d78045af256cc5e704acd1311cc6 /test
parent9c64edf11052f2918f10ccd202bbfda628005562 (diff)
downloaddexon-solidity-1eb7ddbb09b2ff3c65b6329962229ffcc10eaf03.tar
dexon-solidity-1eb7ddbb09b2ff3c65b6329962229ffcc10eaf03.tar.gz
dexon-solidity-1eb7ddbb09b2ff3c65b6329962229ffcc10eaf03.tar.bz2
dexon-solidity-1eb7ddbb09b2ff3c65b6329962229ffcc10eaf03.tar.lz
dexon-solidity-1eb7ddbb09b2ff3c65b6329962229ffcc10eaf03.tar.xz
dexon-solidity-1eb7ddbb09b2ff3c65b6329962229ffcc10eaf03.tar.zst
dexon-solidity-1eb7ddbb09b2ff3c65b6329962229ffcc10eaf03.zip
Make constant and payable mutually exclusive.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 3adf4612..29c0ccba 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -3893,6 +3893,14 @@ BOOST_AUTO_TEST_CASE(illegal_override_payable_nonpayable)
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
}
+BOOST_AUTO_TEST_CASE(payable_constant_conflict)
+{
+ char const* text = R"(
+ contract C { function f() payable constant {} }
+ )";
+ BOOST_CHECK(expectError(text) == Error::Type::TypeError);
+}
+
BOOST_AUTO_TEST_CASE(calling_payable)
{
char const* text = R"(