aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-08-21 22:43:15 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-22 18:39:50 +0800
commit7b0046a9aafffec4e42be7e30c283e07ca1841b9 (patch)
tree34e7bf7755202604bb2e3e39dc8362f187355a28 /libsolidity/analysis
parentb25f0c52ac01857a82dda20ec2b646c7ae90cd7d (diff)
downloaddexon-solidity-7b0046a9aafffec4e42be7e30c283e07ca1841b9.tar.gz
dexon-solidity-7b0046a9aafffec4e42be7e30c283e07ca1841b9.tar.zst
dexon-solidity-7b0046a9aafffec4e42be7e30c283e07ca1841b9.zip
Check inheritance specifier arguments for interfaces.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp10
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(