diff options
author | Christian <c@ethdev.com> | 2015-01-20 02:18:34 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-01-20 06:35:04 +0800 |
commit | 2e846c495b737b7d300fbf92b05881b4acb4ea36 (patch) | |
tree | 9a1be89f7cc20c80e175339482243245f6bed461 /SolidityEndToEndTest.cpp | |
parent | f84d8f2b504332438530abb2456dc2dc809587f6 (diff) | |
download | dexon-solidity-2e846c495b737b7d300fbf92b05881b4acb4ea36.tar dexon-solidity-2e846c495b737b7d300fbf92b05881b4acb4ea36.tar.gz dexon-solidity-2e846c495b737b7d300fbf92b05881b4acb4ea36.tar.bz2 dexon-solidity-2e846c495b737b7d300fbf92b05881b4acb4ea36.tar.lz dexon-solidity-2e846c495b737b7d300fbf92b05881b4acb4ea36.tar.xz dexon-solidity-2e846c495b737b7d300fbf92b05881b4acb4ea36.tar.zst dexon-solidity-2e846c495b737b7d300fbf92b05881b4acb4ea36.zip |
Explicit calls to base class function.
Diffstat (limited to 'SolidityEndToEndTest.cpp')
-rw-r--r-- | SolidityEndToEndTest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp index 934b39ad..0f61d285 100644 --- a/SolidityEndToEndTest.cpp +++ b/SolidityEndToEndTest.cpp @@ -1553,6 +1553,21 @@ BOOST_AUTO_TEST_CASE(single_copy_with_multiple_inheritance) BOOST_CHECK(callContractFunction("getViaB()") == encodeArgs(23)); } +BOOST_AUTO_TEST_CASE(explicit_base_cass) +{ + char const* sourceCode = R"( + contract BaseBase { function g() returns (uint r) { return 1; } } + contract Base is BaseBase { function g() returns (uint r) { return 2; } } + contract Derived is Base { + function f() returns (uint r) { return BaseBase.g(); } + function g() returns (uint r) { return 3; } + } + )"; + compileAndRun(sourceCode, 0, "Derived"); + BOOST_CHECK(callContractFunction("g()") == encodeArgs(3)); + BOOST_CHECK(callContractFunction("f()") == encodeArgs(1)); +} + BOOST_AUTO_TEST_SUITE_END() } |