diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-25 23:32:04 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-03-02 18:51:13 +0800 |
commit | 41f9399a32a200d8e133fac9c39d85cb7b62108c (patch) | |
tree | 345ae7d480b46a7407582e441884a4cf6ab6eefe | |
parent | 54c8e8be9c26a4f989474824574d256a90be9118 (diff) | |
download | dexon-solidity-41f9399a32a200d8e133fac9c39d85cb7b62108c.tar dexon-solidity-41f9399a32a200d8e133fac9c39d85cb7b62108c.tar.gz dexon-solidity-41f9399a32a200d8e133fac9c39d85cb7b62108c.tar.bz2 dexon-solidity-41f9399a32a200d8e133fac9c39d85cb7b62108c.tar.lz dexon-solidity-41f9399a32a200d8e133fac9c39d85cb7b62108c.tar.xz dexon-solidity-41f9399a32a200d8e133fac9c39d85cb7b62108c.tar.zst dexon-solidity-41f9399a32a200d8e133fac9c39d85cb7b62108c.zip |
Adding test for base class statevar accessors
-rw-r--r-- | SolidityNameAndTypeResolution.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp index 4809aac1..e4764c5e 100644 --- a/SolidityNameAndTypeResolution.cpp +++ b/SolidityNameAndTypeResolution.cpp @@ -720,6 +720,18 @@ BOOST_AUTO_TEST_CASE(private_state_variable) BOOST_CHECK_MESSAGE(function == nullptr, "Accessor function of an internal variable should not exist"); } +BOOST_AUTO_TEST_CASE(base_class_state_variable_accessor) +{ + // test for issue #1126 https://github.com/ethereum/cpp-ethereum/issues/1126 + char const* text = "contract Parent {\n" + " uint256 public m_aMember;\n" + "}\n" + "contract Child {\n" + " function foo() returns (uint256) { return Parent.m_aMember(); }\n" + "}\n"; + BOOST_CHECK_NO_THROW(parseTextAndResolveNamesWithChecks(text)); +} + BOOST_AUTO_TEST_CASE(fallback_function) { char const* text = R"( |