mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Improve error message for wrong struct initialization (#3359)
This commit is contained in:
@@ -1551,8 +1551,12 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
|
||||
|
||||
if (!functionType->takesArbitraryParameters() && parameterTypes.size() != arguments.size())
|
||||
{
|
||||
bool isStructConstructorCall = _functionCall.annotation().kind == FunctionCallKind::StructConstructorCall;
|
||||
|
||||
string msg =
|
||||
"Wrong argument count for function call: " +
|
||||
"Wrong argument count for " +
|
||||
string(isStructConstructorCall ? "struct constructor" : "function call") +
|
||||
": " +
|
||||
toString(arguments.size()) +
|
||||
" arguments given but expected " +
|
||||
toString(parameterTypes.size()) +
|
||||
|
||||
Reference in New Issue
Block a user