aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityNameAndTypeResolution.cpp
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-03-12 21:15:04 +0800
committerLiana Husikyan <liana@ethdev.com>2015-03-16 17:46:46 +0800
commit8e6b2c10c38aa7e9ff70620697fc03dcfb0180a7 (patch)
treeba083edaaec11b16e6e3a299273f88ab13505e43 /SolidityNameAndTypeResolution.cpp
parent2ca23b224749ecf709359f04296dfee1f8c5a6d9 (diff)
downloaddexon-solidity-8e6b2c10c38aa7e9ff70620697fc03dcfb0180a7.tar
dexon-solidity-8e6b2c10c38aa7e9ff70620697fc03dcfb0180a7.tar.gz
dexon-solidity-8e6b2c10c38aa7e9ff70620697fc03dcfb0180a7.tar.bz2
dexon-solidity-8e6b2c10c38aa7e9ff70620697fc03dcfb0180a7.tar.lz
dexon-solidity-8e6b2c10c38aa7e9ff70620697fc03dcfb0180a7.tar.xz
dexon-solidity-8e6b2c10c38aa7e9ff70620697fc03dcfb0180a7.tar.zst
dexon-solidity-8e6b2c10c38aa7e9ff70620697fc03dcfb0180a7.zip
- added isPartOfExternalInterface to Declaration
- changed position for the constant specifier. now it goes after type: <type> <constant> <name> = <value> - removed tests for constant functions, checkings for constant function doesn't belong to this story
Diffstat (limited to 'SolidityNameAndTypeResolution.cpp')
-rw-r--r--SolidityNameAndTypeResolution.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp
index cc570ac8..d0163556 100644
--- a/SolidityNameAndTypeResolution.cpp
+++ b/SolidityNameAndTypeResolution.cpp
@@ -1404,22 +1404,12 @@ BOOST_AUTO_TEST_CASE(test_byte_is_alias_of_byte1)
ETH_TEST_REQUIRE_NO_THROW(parseTextAndResolveNames(text), "Type resolving failed");
}
-BOOST_AUTO_TEST_CASE(constant_function_editing_state_variable)
+BOOST_AUTO_TEST_CASE(const_state_variable)
{
char const* text = R"(
contract Foo {
- uint x = 56;
- function editIt() constant { x = 2; }
- })";
- BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
-}
-
-BOOST_AUTO_TEST_CASE(constant_function_editing_const_state_variable)
-{
- char const* text = R"(
- contract Foo {
- constant uint x = 56;
- function editIt() constant { x = 2; }
+ function changeIt() { x = 9; }
+ uint constant x = 56;
})";
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
}