Don't lost diagnostics on real elements when processing fake resolveCall

This commit is contained in:
Mikhael Bogdanov
2013-12-02 12:28:25 +04:00
parent 621a4002e4
commit 9a9527906b
4 changed files with 8 additions and 6 deletions
@@ -228,7 +228,7 @@ public class DelegatedPropertyResolver {
dataFlowInfo, traceToResolveDelegatedProperty);
traceToResolveDelegatedProperty.commit(new TraceEntryFilter() {
@Override
public boolean accept(@NotNull WritableSlice<?, ?> slice, Object key) {
public boolean accept(@Nullable WritableSlice<?, ?> slice, Object key) {
return slice != CONSTRAINT_SYSTEM_COMPLETER;
}
}, true);
@@ -146,7 +146,9 @@ public class DelegatingBindingTrace implements BindingTrace {
if (!commitDiagnostics) return;
for (Diagnostic diagnostic : diagnostics) {
trace.report(diagnostic);
if (filter == null || filter.accept(null, diagnostic.getPsiElement())) {
trace.report(diagnostic);
}
}
}
@@ -16,9 +16,9 @@
package org.jetbrains.jet.lang.resolve;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.util.slicedmap.WritableSlice;
public interface TraceEntryFilter {
boolean accept(@NotNull WritableSlice<?, ?> slice, Object key);
boolean accept(@Nullable WritableSlice<?, ?> slice, Object key);
}
@@ -380,11 +380,11 @@ public class ExpressionTypingUtils {
if (results.isSuccess()) {
fakeTrace.commit(new TraceEntryFilter() {
@Override
public boolean accept(@NotNull WritableSlice<?, ?> slice, Object key) {
public boolean accept(@Nullable WritableSlice<?, ?> slice, Object key) {
// excluding all entries related to fake expression
return key != fake;
}
}, false);
}, true);
}
return Pair.create(call, results);
}