From 18eeee536d29e4cf63b106853fc68673729585d3 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 28 Jan 2015 16:48:27 +0100 Subject: [PATCH] Function name clashing with Statevariable accessor test --- SolidityNameAndTypeResolution.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp index 3b711bfec..bc0edb504 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"