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

public class QualifierTyping extends Object implements Constraint
Represents a constraint between two AbstractType. One of:

Do NOT override equals or hashCode in this class. The inference solver relies on identity equality to allow multiple identically-shaped constraints to coexist without being deduplicated by ConstraintSet.

  • Constructor Details

    • QualifierTyping

      public QualifierTyping(AbstractQualifier Q, AbstractQualifier R, Constraint.Kind kind)
      Creates a qualifier typing constraint.
      Parameters:
      Q - the qualifiers on the left-hand side of the constraint
      R - the qualifiers on the right-hand side of the constraint
      kind - the kind of qualifier 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
    • getInputVariables

      public Set<Variable> getInputVariables()
      Returns the empty set: a qualifier constraint relates two qualifiers (Q <: R or Q = R) directly, not the type of a poly expression (a lambda, a method reference, a conditional expression, or a switch expression) whose type depends on a target type that may still be unresolved. JLS 18.5.2.2's input variables exist only to order the reduction of those poly-expression-typing constraints relative to the target types they depend on, so that notion does not apply to a qualifier constraint: it can always be reduced immediately.
      Specified by:
      getInputVariables in interface Constraint
      Returns:
      the empty set
    • reduce

      public ReductionResult 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
    • toString

      public String toString()
      Overrides:
      toString in class Object