From c86a46b84d13cd0c12c6a2ea1bc2b096b9d1a539 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 22 Jan 2015 01:02:38 +0100 Subject: Type resolution for function modifiers. --- SolidityEndToEndTest.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'SolidityEndToEndTest.cpp') diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp index cf04edaa..8bce1788 100644 --- a/SolidityEndToEndTest.cpp +++ b/SolidityEndToEndTest.cpp @@ -1650,6 +1650,26 @@ BOOST_AUTO_TEST_CASE(constructor_argument_overriding) BOOST_CHECK(callContractFunction("getA()") == encodeArgs(3)); } +BOOST_AUTO_TEST_CASE(function_modifier) +{ + char const* sourceCode = R"( + contract BaseBase { + uint m_a; + function BaseBase(uint a) { + m_a = a; + } + } + contract Base is BaseBase(2) { } + contract Derived is Base, BaseBase(3) { + function getA() returns (uint r) { return m_a; } + } + )"; + compileAndRun(sourceCode, 0, "Derived"); + BOOST_CHECK(callContractFunction("getA()") == encodeArgs(3)); +} + +// modifier overriding + BOOST_AUTO_TEST_SUITE_END() } -- cgit v1.2.3