diff options
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 7 | ||||
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 851266bd..01de5eb0 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -337,6 +337,7 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance) auto const& arguments = _inheritance.arguments(); TypePointers parameterTypes = ContractType(*base).constructorType()->parameterTypes(); if (!arguments.empty() && parameterTypes.size() != arguments.size()) + { typeError( _inheritance.location(), "Wrong argument count for constructor call: " + @@ -345,6 +346,8 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance) toString(parameterTypes.size()) + "." ); + return; + } for (size_t i = 0; i < arguments.size(); ++i) if (!type(*arguments[i])->isImplicitlyConvertibleTo(*parameterTypes[i])) @@ -950,7 +953,7 @@ bool TypeChecker::visit(FunctionCall const& _functionCall) else _functionCall.annotation().type = make_shared<TupleType>(functionType->returnParameterTypes()); - TypePointers const& parameterTypes = functionType->parameterTypes(); + TypePointers parameterTypes = functionType->parameterTypes(); if (!functionType->takesArbitraryParameters() && parameterTypes.size() != arguments.size()) { string msg = @@ -1079,7 +1082,7 @@ void TypeChecker::endVisit(NewExpression const& _newExpression) ); auto contractType = make_shared<ContractType>(*contract); - TypePointers const& parameterTypes = contractType->constructorType()->parameterTypes(); + TypePointers parameterTypes = contractType->constructorType()->parameterTypes(); _newExpression.annotation().type = make_shared<FunctionType>( parameterTypes, TypePointers{contractType}, diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index a090a28c..dcdab2a7 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -85,7 +85,7 @@ void ExpressionCompiler::appendStateVariableAccessor(VariableDeclaration const& CompilerContext::LocationSetter locationSetter(m_context, _varDecl); FunctionType accessorType(_varDecl); - TypePointers const& paramTypes = accessorType.parameterTypes(); + TypePointers paramTypes = accessorType.parameterTypes(); // retrieve the position of the variable auto const& location = m_context.storageLocationOfVariable(_varDecl); @@ -380,7 +380,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) else functionType = dynamic_pointer_cast<FunctionType const>(_functionCall.expression().annotation().type); - TypePointers const& parameterTypes = functionType->parameterTypes(); + TypePointers parameterTypes = functionType->parameterTypes(); vector<ASTPointer<Expression const>> const& callArguments = _functionCall.arguments(); vector<ASTPointer<ASTString>> const& callArgumentNames = _functionCall.names(); if (!functionType->takesArbitraryParameters()) |