Skip to content

Commit

Permalink
Better error message for multiple method candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher committed Jul 20, 2017
1 parent 1d672cd commit 25ce897
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1158,10 +1158,10 @@ TypedValue* deduceFunction(Compiler *c, FunctionCandidates *fc, vector<TypedValu
if(!argTys.empty())
msg = msg + " with args " + typeNodeToColoredStr(mkTypeNodeWithExt(TT_Tuple, toList(argTys)));

c->compErr("Multiple equally-matching candidates found for call to "+fc->candidates[0]->fdn->basename, loc);
c->compErr(msg, loc);
}catch(CtError *e){
for(auto &fd : fc->candidates){
c->compErr("Candidate", fd->fdn->loc, ErrorType::Note);
for(auto &p : matches){
c->compErr("Candidate", p.second->fdn->loc, ErrorType::Note);
}
throw e;
}
Expand Down

0 comments on commit 25ce897

Please sign in to comment.