diff options
Diffstat (limited to 'java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceVariable.java')
-rw-r--r-- | java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceVariable.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceVariable.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceVariable.java index f750e1247728..593194354b7d 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceVariable.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceVariable.java @@ -43,6 +43,10 @@ public class InferenceVariable { public void setInstantiation(PsiType instantiation) { myInstantiation = instantiation; } + + public void ignoreInstantiation() { + myInstantiation = PsiType.NULL; + } public boolean isCaptured() { return myCaptured; @@ -70,4 +74,14 @@ public class InferenceVariable { final List<PsiType> bounds = myBounds.get(inferenceBound); return bounds != null ? new ArrayList<PsiType>(bounds) : Collections.<PsiType>emptyList(); } + + public Set<InferenceVariable> getDependencies(InferenceSession session) { + final HashSet<InferenceVariable> dependencies = new HashSet<InferenceVariable>(); + for (InferenceBound inferenceBound : InferenceBound.values()) { + for (PsiType bound : getBounds(inferenceBound)) { + session.collectDependencies(bound, dependencies, true); + } + } + return dependencies; + } } |