Commit 58e3a4aa by Tianqi Yang

fix(overload): check only valid methods while checking candidates

Check only methods which can be a valid call while checking whether a function can be a candidate
parent fb0b5550
...@@ -170,8 +170,9 @@ public final class FuncUtils ...@@ -170,8 +170,9 @@ public final class FuncUtils
for (Function func : functions) { for (Function func : functions) {
if (errorIter.next() == null) { if (errorIter.next() == null) {
boolean comp = false; boolean comp = false;
Iterator<DecafError> errorIter2 = errorList.iterator();
for (Function func2 : functions) { for (Function func2 : functions) {
if (!func2.equals(func) && checkFunctionCompatible(func2, func)) { if (errorIter2.next() == null && !func2.equals(func) && checkFunctionCompatible(func2, func)) {
comp = true; comp = true;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment