@@ -8251,7 +8251,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
82518251 return setError();
82528252 }
82538253
8254- void errorHelper(const(char)* failMessage) scope
8254+ void errorHelper(const(char)* failMessage, Loc argloc ) scope
82558255 {
82568256 OutBuffer buf;
82578257 buf.writeByte('(');
@@ -8264,7 +8264,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
82648264 .error(exp.loc, "%s `%s` is not callable using argument types `%s`",
82658265 p, exp.e1.toErrMsg(), buf.peekChars());
82668266 if (failMessage)
8267- errorSupplemental(exp.loc, "%s", failMessage);
8267+ errorSupplemental((argloc !is Loc.initial) ? argloc : exp.loc, "%s", failMessage);
82688268 }
82698269
82708270 if (callMatch(exp.f, tf, null, exp.argumentList, 0, &errorHelper, sc) == MATCH.nomatch)
@@ -8327,7 +8327,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
83278327 exp.f = exp.f.toAliasFunc();
83288328 TypeFunction tf = cast(TypeFunction)exp.f.type;
83298329
8330- void errorHelper2(const(char)* failMessage) scope
8330+ void errorHelper2(const(char)* failMessage, Loc argloc ) scope
83318331 {
83328332 OutBuffer buf;
83338333 buf.writeByte('(');
@@ -8345,7 +8345,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
83458345 .error(exp.loc, "%s `%s` is not callable using argument types `%s`",
83468346 exp.f.kind(), exp.f.toErrMsg(), buf.peekChars());
83478347 if (failMessage)
8348- errorSupplemental(exp.loc, "%s", failMessage);
8348+ errorSupplemental((argloc !is Loc.initial) ? argloc : exp.loc, "%s", failMessage);
83498349 .errorSupplemental(exp.f.loc, "`%s%s` declared here", exp.f.toPrettyChars(), parametersTypeToChars(tf.parameterList));
83508350 exp.f = null;
83518351 }
0 commit comments