diff options
author | chriseth <chris@ethereum.org> | 2017-08-21 22:43:15 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-22 18:39:50 +0800 |
commit | 7b0046a9aafffec4e42be7e30c283e07ca1841b9 (patch) | |
tree | 34e7bf7755202604bb2e3e39dc8362f187355a28 /libsolidity | |
parent | b25f0c52ac01857a82dda20ec2b646c7ae90cd7d (diff) | |
download | dexon-solidity-7b0046a9aafffec4e42be7e30c283e07ca1841b9.tar.gz dexon-solidity-7b0046a9aafffec4e42be7e30c283e07ca1841b9.tar.zst dexon-solidity-7b0046a9aafffec4e42be7e30c283e07ca1841b9.zip |
Check inheritance specifier arguments for interfaces.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index f70b75d3..99f3c64c 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -429,12 +429,12 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance) if (base->isLibrary()) m_errorReporter.typeError(_inheritance.location(), "Libraries cannot be inherited from."); - // Interface can have no constructors - no need to validate - if (base->contractKind() == ContractDefinition::ContractKind::Interface) - return; - auto const& arguments = _inheritance.arguments(); - TypePointers parameterTypes = ContractType(*base).newExpressionType()->parameterTypes(); + TypePointers parameterTypes; + if (base->contractKind() != ContractDefinition::ContractKind::Interface) + // Interfaces do not have constructors, so there are zero parameters. + parameterTypes = ContractType(*base).newExpressionType()->parameterTypes(); + if (!arguments.empty() && parameterTypes.size() != arguments.size()) { m_errorReporter.typeError( |