Skip to content

Commit

Permalink
Concrete types are preferred over generic types when performing funct…
Browse files Browse the repository at this point in the history
…ion deduction
  • Loading branch information
jfecher committed Jul 20, 2017
1 parent 25ce897 commit 62a0e62
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ vector<pair<TypeCheckResult,FuncDecl*>> filterHighestMatches(vector<pair<TypeChe
vector<pair<TypeCheckResult,FuncDecl*>> highestMatches;

for(auto &tcr : matches){
if(tcr.first->matches >= highestMatch){
if(!!tcr.first and tcr.first->matches >= highestMatch){
if(tcr.first->matches > highestMatch){
highestMatch = tcr.first->matches;
highestMatches.clear();
Expand Down
1 change: 0 additions & 1 deletion src/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ TypeCheckResult TypeCheckResult::success(){
TypeCheckResult TypeCheckResult::successWithTypeVars(){
if(box->res != Failure){
box->res = SuccessWithTypeVars;
box->matches++;
}
return *this;
}
Expand Down

0 comments on commit 62a0e62

Please sign in to comment.