java.lang.Object
org.checkerframework.framework.util.typeinference8.constraint.AdditionalArgument
All Implemented Interfaces:
Constraint, ReductionResult

public class AdditionalArgument extends Object implements Constraint
A constraint that represents additional argument constraints generated from a method or constructor invocation that is a part of a larger inference problem. When this constraint is reduced it will generate more constraints from the invocation. This is because creating the constraints might use the type of an implicit lambda parameter for which the larger inference problem has not yet found a type. So, the additional constraints cannot be created until after the implicit lambda parameter has a type.
  • Constructor Details

    • AdditionalArgument

      public AdditionalArgument(ExpressionTree methodOrConstructorInvocation)
      Creates a new constraint.
      Parameters:
      methodOrConstructorInvocation - tree for the method or constructor invocation for this constraint
  • Method Details

    • getKind

      public Constraint.Kind getKind()
      Description copied from interface: Constraint
      Returns the kind of constraint.
      Specified by:
      getKind in interface Constraint
      Returns:
      the kind of constraint
    • reduce

      public ConstraintSet reduce(Java8InferenceContext context)
      Description copied from interface: Constraint
      Reduce this constraint; what this means depends on the kind of constraint. Reduction can produce new bounds and/or new constraints.

      Reduction is documented in JLS section 18.2

      Specified by:
      reduce in interface Constraint
      Parameters:
      context - Java8InferenceContext
      Returns:
      the result of reducing this constraint
    • equals

      public boolean equals(Object o)

      Two AdditionalArguments are equal if they are for the same invocation. Because JCTree does not override equals, this compares the two trees by reference: constraints for two textually identical invocations at different places in the source code are not equal.

      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object