Don't lost diagnostics on real elements when processing fake resolveCall
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user