Skip to content

Commit

Permalink
Provide a useful error message when the same named parameter is provi…
Browse files Browse the repository at this point in the history
…ded multiple times.
  • Loading branch information
Orvid committed Sep 29, 2023
1 parent 07f8f63 commit 6378be5
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,13 @@ void PapyrusFunctionCallExpression::semantic(PapyrusResolutionContext* ctx, Papy
auto a = *iter;
++iter;
a->argIndex = p->index;
newArgs.insertBefore(newArgsIter, a);
if (newArgsIter != newArgs.endInsertable() && idEq(newArgsIter->name, a->name)) {
ctx->reportingContext.error(a->value->location,
"Duplicate named parameter provided '{}'!",
a->name);
} else {
newArgs.insertBefore(newArgsIter, a);
}
goto ContinueOuterLoop;
}
if (newArgsIter != newArgs.endInsertable() && newArgsIter->argIndex <= p->index)
Expand Down

0 comments on commit 6378be5

Please sign in to comment.