java.lang.Object
org.checkerframework.framework.util.typeinference8.bound.CaptureBound

public class CaptureBound extends Object
A bound of the form: G<a1, ..., an> = capture(G<A1, ..., An>). The variables a1, ..., an represent the result of capture conversion applied to G<A1, ..., An> (where A1, ..., An may be types or wildcards and may mention inference variables).
  • Method Details

    • createAndIncorporateCaptureConstraint

      public static BoundSet createAndIncorporateCaptureConstraint(AbstractType r, AbstractType target, ExpressionTree invocation, Java8InferenceContext context)
      Given r, a parameterized type, G<A1, ..., An>}, and one of A1, ..., An is a wildcard, then, for fresh inference variables B1, ..., Bn, the constraint formula <G<B1, ..., Bn> -> T> is reduced and incorporated, along with the bound G<B1, ..., Bn> = capture(G<A1, ..., An>), with B2.
      Parameters:
      r - a parameterized type, G<A1, ..., An>, and one of A1, ..., An is a wildcard
      target - target of the constraint
      invocation - invocation a method or constructor invocation; used to create fresh inference variables
      context - the context
      Returns:
      the result of incorporating the created capture constraint
    • getAllVariablesOnLHS

      public List<? extends CaptureVariable> getAllVariablesOnLHS()
      Return all variables on the left-hand side of this capture.
      Returns:
      all variables on the left-hand side of this capture
    • getAllVariablesOnRHS

      public Set<Variable> getAllVariablesOnRHS()
      Return all variables on the right-hand side of this capture.
      Returns:
      all variables on the right-hand side of this capture
    • isCaptureMentionsAny

      public boolean isCaptureMentionsAny(Collection<Variable> variables)
      Returns whether this bound contains any variables.
      Parameters:
      variables - inference variables
      Returns:
      whether this bound contains any variables