mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #289 from chriseth/fix_base_constructor_params
Fix: Type checker crash for wrong number of base constructor arguments.
This commit is contained in:
commit
251e7aa462
@ -337,6 +337,7 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance)
|
|||||||
auto const& arguments = _inheritance.arguments();
|
auto const& arguments = _inheritance.arguments();
|
||||||
TypePointers parameterTypes = ContractType(*base).constructorType()->parameterTypes();
|
TypePointers parameterTypes = ContractType(*base).constructorType()->parameterTypes();
|
||||||
if (!arguments.empty() && parameterTypes.size() != arguments.size())
|
if (!arguments.empty() && parameterTypes.size() != arguments.size())
|
||||||
|
{
|
||||||
typeError(
|
typeError(
|
||||||
_inheritance.location(),
|
_inheritance.location(),
|
||||||
"Wrong argument count for constructor call: " +
|
"Wrong argument count for constructor call: " +
|
||||||
@ -345,6 +346,8 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance)
|
|||||||
toString(parameterTypes.size()) +
|
toString(parameterTypes.size()) +
|
||||||
"."
|
"."
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < arguments.size(); ++i)
|
for (size_t i = 0; i < arguments.size(); ++i)
|
||||||
if (!type(*arguments[i])->isImplicitlyConvertibleTo(*parameterTypes[i]))
|
if (!type(*arguments[i])->isImplicitlyConvertibleTo(*parameterTypes[i]))
|
||||||
|
Loading…
Reference in New Issue
Block a user