diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-04-02 23:42:43 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-04-17 21:27:31 +0800 |
commit | eb84c3171aa362c507c7213c937748b9e9f78ca9 (patch) | |
tree | 745564cabfc7bc9fd5b3704a6d3b72eb6ba4b5a0 /AST.cpp | |
parent | 0c296cd8093af05507426f9a5a5b25bb2b51f4fb (diff) | |
download | dexon-solidity-eb84c3171aa362c507c7213c937748b9e9f78ca9.tar.gz dexon-solidity-eb84c3171aa362c507c7213c937748b9e9f78ca9.tar.zst dexon-solidity-eb84c3171aa362c507c7213c937748b9e9f78ca9.zip |
Add "this" contract's ctor to provided ctors set
- Also properly naming the 2 sets in checkAbstractConstructors() function
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -166,7 +166,7 @@ void ContractDefinition::checkAbstractConstructors() if (constructor) { if (!constructor->getParameters().empty()) - argumentsProvided.insert(constructor); + argumentsNeeded.insert(constructor); for (auto const& modifier: constructor->getModifiers()) { auto baseContract = dynamic_cast<ContractDefinition const*>( @@ -174,8 +174,8 @@ void ContractDefinition::checkAbstractConstructors() if (baseContract) { FunctionDefinition const* baseConstructor = baseContract->getConstructor(); - if (argumentsProvided.count(baseConstructor) == 1) - argumentsNeeded.insert(baseConstructor); + if (argumentsNeeded.count(baseConstructor) == 1) + argumentsProvided.insert(baseConstructor); } } } @@ -186,10 +186,13 @@ void ContractDefinition::checkAbstractConstructors() base->getName()->getReferencedDeclaration()); solAssert(baseContract, ""); FunctionDefinition const* baseConstructor = baseContract->getConstructor(); - if (argumentsProvided.count(baseConstructor) == 1) - argumentsNeeded.insert(baseConstructor); + if (argumentsNeeded.count(baseConstructor) == 1) + argumentsProvided.insert(baseConstructor); } } + // add this contract's constructor to the provided too + if (getConstructor() && !getConstructor()->getParameters().empty()) + argumentsProvided.insert(getConstructor()); if (argumentsProvided != argumentsNeeded) setFullyImplemented(false); } |