aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorFederico Bond <federicobond@gmail.com>2018-01-04 18:24:39 +0800
committerchriseth <chris@ethereum.org>2018-01-04 18:24:39 +0800
commita0771691ff1a8ea8b2dda07ff50e48fc81a2a705 (patch)
treee7ffc52054042274dceb8702f609d1a448173cac /libsolidity
parentfdbe78a7693aef51a69ec4399de4f9b919ae1675 (diff)
downloaddexon-solidity-a0771691ff1a8ea8b2dda07ff50e48fc81a2a705.tar.gz
dexon-solidity-a0771691ff1a8ea8b2dda07ff50e48fc81a2a705.tar.zst
dexon-solidity-a0771691ff1a8ea8b2dda07ff50e48fc81a2a705.zip
Improve error message for wrong struct initialization (#3359)
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 090e5159..75d71925 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -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()) +