Merge pull request #4241 from ethereum/show-named-arg

Show named argument name in error
This commit is contained in:
Alex Beregszaszi 2018-06-06 16:32:08 +01:00 committed by GitHub
commit 24ca596c66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ Bugfixes:
Features:
* Type Checker: Show named argument in case of error.
Bugfixes:

View File

@ -1918,7 +1918,7 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
if (!found)
m_errorReporter.typeError(
_functionCall.location(),
"Named argument does not match function declaration."
"Named argument \"" + *argumentNames[i] + "\" does not match function declaration."
);
}
}

View File

@ -8,4 +8,4 @@ contract test {
}
// ----
// Warning: (31-37): This declaration shadows an existing declaration.
// TypeError: (153-168): Named argument does not match function declaration.
// TypeError: (153-168): Named argument "c" does not match function declaration.