mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 05:21:29 +07:00
inference: cache erasure flag together with partial inference (IDEA-150802)
This commit is contained in:
@@ -101,6 +101,7 @@ public class InferenceSession {
|
||||
myIncorporationPhase.addCapture(capture.first, capture.second);
|
||||
}
|
||||
myInferenceSessionContainer = initialState.getInferenceSessionContainer();
|
||||
myErased = initialState.isErased();
|
||||
}
|
||||
|
||||
public InferenceSession(PsiTypeParameter[] typeParams,
|
||||
@@ -594,6 +595,7 @@ public class InferenceSession {
|
||||
myInferenceSubstitution,
|
||||
mySiteSubstitutor,
|
||||
myIncorporationPhase.getCaptures(),
|
||||
myErased,
|
||||
container);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ class InitialInferenceState {
|
||||
private final PsiSubstitutor mySiteSubstitutor;
|
||||
private final ArrayList<Pair<InferenceVariable[], PsiClassType>> myCaptures;
|
||||
private final InferenceSessionContainer myInferenceSessionContainer;
|
||||
private final boolean myErased;
|
||||
|
||||
InitialInferenceState(Set<InferenceVariable> inferenceVariables,
|
||||
PsiSubstitutor topInferenceSubstitutor,
|
||||
@@ -39,7 +40,9 @@ class InitialInferenceState {
|
||||
PsiSubstitutor inferenceSubstitutor,
|
||||
PsiSubstitutor siteSubstitutor,
|
||||
List<Pair<InferenceVariable[], PsiClassType>> captures,
|
||||
boolean erased,
|
||||
InferenceSessionContainer inferenceSessionContainer) {
|
||||
myErased = erased;
|
||||
myInferenceVariables = new HashSet<InferenceVariable>();
|
||||
PsiSubstitutor substitutor = PsiSubstitutor.EMPTY;
|
||||
PsiSubstitutor subst = PsiSubstitutor.EMPTY;
|
||||
@@ -93,4 +96,8 @@ class InitialInferenceState {
|
||||
public ArrayList<Pair<InferenceVariable[], PsiClassType>> getCaptures() {
|
||||
return myCaptures;
|
||||
}
|
||||
|
||||
public boolean isErased() {
|
||||
return myErased;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
abstract class Test {
|
||||
public void some(final ArrayList<ProcessingRule<String>> rules,
|
||||
final Context context) {
|
||||
rules.add (createRule(context));
|
||||
}
|
||||
|
||||
abstract <E extends CharSequence> ProcessingRule<E> createRule(Context<E> context);
|
||||
}
|
||||
|
||||
interface ProcessingRule<T> {}
|
||||
class Context<T> {}
|
||||
@@ -363,6 +363,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPushErasedStateToArguments() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user