aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-28 23:48:27 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-29 04:46:17 +0800
commit18eeee536d29e4cf63b106853fc68673729585d3 (patch)
tree3fc3cd4b917a3b033b6ce557e09d3968fde6036c
parent59bf3e91e66bdaf1daad749414e3c4a66f8f29c2 (diff)
downloaddexon-solidity-18eeee536d29e4cf63b106853fc68673729585d3.tar.gz
dexon-solidity-18eeee536d29e4cf63b106853fc68673729585d3.tar.zst
dexon-solidity-18eeee536d29e4cf63b106853fc68673729585d3.zip
Function name clashing with Statevariable accessor test
-rw-r--r--SolidityNameAndTypeResolution.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp
index 3b711bfe..bc0edb50 100644
--- a/SolidityNameAndTypeResolution.cpp
+++ b/SolidityNameAndTypeResolution.cpp
@@ -650,6 +650,18 @@ BOOST_AUTO_TEST_CASE(state_variable_accessors)
BOOST_CHECK(function.isConstant());
}
+BOOST_AUTO_TEST_CASE(function_clash_with_state_variable_accessor)
+{
+ char const* text = "contract test {\n"
+ " function fun() {\n"
+ " uint64(2);\n"
+ " }\n"
+ "uint256 foo;\n"
+ " function foo() {}\n"
+ "}\n";
+ BOOST_CHECK_THROW(parseTextAndResolveNames(text), DeclarationError);
+}
+
BOOST_AUTO_TEST_CASE(private_state_variable)
{
char const* text = "contract test {\n"