aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libsolidity/SolidityNameAndTypeResolution.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/libsolidity/SolidityNameAndTypeResolution.cpp b/libsolidity/SolidityNameAndTypeResolution.cpp
index df976eae..4914ef97 100644
--- a/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -403,6 +403,23 @@ BOOST_AUTO_TEST_CASE(abstract_contract)
BOOST_CHECK(derived->getDefinedFunctions()[0]->isFullyImplemented());
}
+BOOST_AUTO_TEST_CASE(abstract_contract_with_overload)
+{
+ ASTPointer<SourceUnit> sourceUnit;
+ char const* text = R"(
+ contract base { function foo(bool); }
+ contract derived is base { function foo(uint) {} }
+ )";
+ ETH_TEST_REQUIRE_NO_THROW(sourceUnit = parseTextAndResolveNames(text), "Parsing and name Resolving failed");
+ std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->getNodes();
+ ContractDefinition* base = dynamic_cast<ContractDefinition*>(nodes[0].get());
+ ContractDefinition* derived = dynamic_cast<ContractDefinition*>(nodes[1].get());
+ BOOST_REQUIRE(base);
+ BOOST_CHECK(!base->isFullyImplemented());
+ BOOST_REQUIRE(derived);
+ BOOST_CHECK(!derived->isFullyImplemented());
+}
+
BOOST_AUTO_TEST_CASE(create_abstract_contract)
{
ASTPointer<SourceUnit> sourceUnit;