diff options
author | Christian <c@ethdev.com> | 2015-01-20 06:08:48 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-01-20 06:35:04 +0800 |
commit | 961cb5b90c70534df3704c2a905fa0b42f35bfbd (patch) | |
tree | d588528f702d9459b6e4fef668db286779d624b4 /SolidityNameAndTypeResolution.cpp | |
parent | fe770957c68007ccf86eddb639b596e78fd7b9ba (diff) | |
download | dexon-solidity-961cb5b90c70534df3704c2a905fa0b42f35bfbd.tar.gz dexon-solidity-961cb5b90c70534df3704c2a905fa0b42f35bfbd.tar.zst dexon-solidity-961cb5b90c70534df3704c2a905fa0b42f35bfbd.zip |
Call constructors of base classes.
Diffstat (limited to 'SolidityNameAndTypeResolution.cpp')
-rw-r--r-- | SolidityNameAndTypeResolution.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp index 8cc45ce6..c0ebb0ed 100644 --- a/SolidityNameAndTypeResolution.cpp +++ b/SolidityNameAndTypeResolution.cpp @@ -451,6 +451,24 @@ BOOST_AUTO_TEST_CASE(overriding_constructor) BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text)); } +BOOST_AUTO_TEST_CASE(missing_base_constructor_arguments) +{ + char const* text = R"( + contract A { function A(uint a) { } } + contract B is A { } + )"; + BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError); +} + +BOOST_AUTO_TEST_CASE(base_constructor_arguments_override) +{ + char const* text = R"( + contract A { function A(uint a) { } } + contract B is A { } + )"; + BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError); +} + BOOST_AUTO_TEST_SUITE_END() } |