diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/ResolutionTaskHolder.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/ResolutionTaskHolder.java index f5c0ffa0011..ee25d9ef892 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/ResolutionTaskHolder.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/ResolutionTaskHolder.java @@ -31,9 +31,6 @@ import java.util.Collection; import java.util.List; public class ResolutionTaskHolder { - private static final int MIN_PRIORITY = 0; - private static final int MAX_PRIORITY = 3; - private final JetReferenceExpression reference; private final BasicCallResolutionContext basicCallResolutionContext; private final PriorityProvider> priorityProvider; @@ -97,7 +94,7 @@ public class ResolutionTaskHolder { } candidateList.addAll(nonLocalExtensions); - for (int priority = MAX_PRIORITY; priority >= MIN_PRIORITY; priority--) { + for (int priority = priorityProvider.getMaxPriority(); priority >= 0; priority--) { final int finalPriority = priority; for (Collection> candidates : candidateList) { Collection> filteredCandidates = Collections2.filter(candidates, new Predicate>() { @@ -117,5 +114,7 @@ public class ResolutionTaskHolder { public interface PriorityProvider { int getPriority(D candidate); + + int getMaxPriority(); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/TaskPrioritizer.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/TaskPrioritizer.java index 5e183d75fe8..99f118cd3ae 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/TaskPrioritizer.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/TaskPrioritizer.java @@ -92,6 +92,11 @@ public class TaskPrioritizer { return (isVisible(call) ? 2 : 0) + (isSynthesized(call) ? 1 : 0); } + @Override + public int getMaxPriority() { + return 3; + } + private boolean isVisible(ResolutionCandidate call) { if (call == null) return false; D candidateDescriptor = call.getDescriptor();