aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-06-29 06:18:22 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-08-01 19:28:27 +0800
commit061ea0cfc6b8a7a0950e9764876733391eac6b81 (patch)
tree06abd44acaab66882c32b189562e9c1cd6182b63 /libsolidity
parent7e5406dd8953cb819c397221fa55e6fa390108ee (diff)
downloaddexon-solidity-061ea0cfc6b8a7a0950e9764876733391eac6b81.tar.gz
dexon-solidity-061ea0cfc6b8a7a0950e9764876733391eac6b81.tar.zst
dexon-solidity-061ea0cfc6b8a7a0950e9764876733391eac6b81.zip
Correctly determine whether base constructor is called without parentheses.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 9e10b9b2..97033b0d 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -286,19 +286,19 @@ void TypeChecker::checkContractBaseConstructorArguments(ContractDefinition const
{
if (FunctionDefinition const* constructor = contract->constructor())
for (auto const& modifier: constructor->modifiers())
- {
- auto baseContract = dynamic_cast<ContractDefinition const*>(&dereference(*modifier->name()));
- if (modifier->arguments())
+ if (auto baseContract = dynamic_cast<ContractDefinition const*>(&dereference(*modifier->name())))
{
- if (baseContract && baseContract->constructor())
- annotateBaseConstructorArguments(_contract, baseContract->constructor(), modifier.get());
+ if (modifier->arguments())
+ {
+ if (baseContract->constructor())
+ annotateBaseConstructorArguments(_contract, baseContract->constructor(), modifier.get());
+ }
+ else
+ m_errorReporter.declarationError(
+ modifier->location(),
+ "Modifier-style base constructor call without arguments."
+ );
}
- else
- m_errorReporter.declarationError(
- modifier->location(),
- "Modifier-style base constructor call without arguments."
- );
- }
for (ASTPointer<InheritanceSpecifier> const& base: contract->baseContracts())
{