aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-06-07 01:36:19 +0800
committerchriseth <c@ethdev.com>2016-06-07 01:38:22 +0800
commitab7a22f4a0d95faacf453b76415eaee167aacdec (patch)
tree94a6f6ea9cffd3eaed15e8641b6fa3ae7523de60 /libsolidity/analysis
parenta1aee031d1fd1b773c2184280625a00a6c84ae7d (diff)
downloaddexon-solidity-ab7a22f4a0d95faacf453b76415eaee167aacdec.tar.gz
dexon-solidity-ab7a22f4a0d95faacf453b76415eaee167aacdec.tar.zst
dexon-solidity-ab7a22f4a0d95faacf453b76415eaee167aacdec.zip
Disallow implementation of abstract function by constructor of derived class.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 5ae0443a..ce55de00 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -32,7 +32,7 @@ using namespace dev;
using namespace dev::solidity;
-bool TypeChecker::checkTypeRequirements(const ContractDefinition& _contract)
+bool TypeChecker::checkTypeRequirements(ContractDefinition const& _contract)
{
try
{
@@ -174,6 +174,9 @@ void TypeChecker::checkContractAbstractFunctions(ContractDefinition const& _cont
for (ContractDefinition const* contract: boost::adaptors::reverse(_contract.annotation().linearizedBaseContracts))
for (FunctionDefinition const* function: contract->definedFunctions())
{
+ // Take constructors out of overload hierarchy
+ if (function->isConstructor())
+ continue;
auto& overloads = functions[function->name()];
FunctionTypePointer funType = make_shared<FunctionType>(*function);
auto it = find_if(overloads.begin(), overloads.end(), [&](FunTypeAndFlag const& _funAndFlag)