Fix wrong name used in error message when reporting invalid named argument

This commit is contained in:
Kamil Śliwak 2020-09-17 17:21:47 +02:00
parent 4045f41c8d
commit aae640dd3a
3 changed files with 7 additions and 7 deletions

View File

@ -19,6 +19,7 @@ Compiler Features:
Bugfixes:
* Code generator: Fix internal error on stripping dynamic types from return parameters on EVM versions without ``RETURNDATACOPY``.
* Type Checker: Disallow ``virtual`` for modifiers in libraries.
* Type Checker: Correct the error message for invalid named parameter in a call to refer to the right argument.
* Type Checker: Correct the warning for homonymous, but not shadowing declarations.
* ViewPureChecker: Prevent visibility check on constructors.
* Type system: Fix internal error on implicit conversion of contract instance to the type of its ``super``.

View File

@ -2091,18 +2091,17 @@ void TypeChecker::typeCheckFunctionGeneralChecks(
{
bool not_all_mapped = false;
for (size_t i = 0; i < paramArgMap.size(); i++)
for (size_t i = 0; i < argumentNames.size(); i++)
{
size_t j;
for (j = 0; j < argumentNames.size(); j++)
if (parameterNames[i] == *argumentNames[j])
for (j = 0; j < parameterNames.size(); j++)
if (parameterNames[j] == *argumentNames[i])
break;
if (j < argumentNames.size())
paramArgMap[i] = arguments[j].get();
if (j < parameterNames.size())
paramArgMap[j] = arguments[i].get();
else
{
paramArgMap[i] = nullptr;
not_all_mapped = true;
m_errorReporter.typeError(
4974_error,

View File

@ -10,4 +10,4 @@ contract test {
}
}
// ----
// TypeError 4974: (249-288): Named argument "a" does not match function declaration.
// TypeError 4974: (249-288): Named argument "x" does not match function declaration.