Class QualifierTyping
java.lang.Object
org.checkerframework.framework.util.typeinference8.constraint.QualifierTyping
- All Implemented Interfaces:
Constraint,ReductionResult
Represents a constraint between two
AbstractType. One of:
Constraint.Kind.QUALIFIER_SUBTYPE< Q <: R >: A qualifier Q is a subtype of a qualifier R.Constraint.Kind.QUALIFIER_EQUALITY< Q = R >: A qualifier Q is the same as a qualifier R.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.checkerframework.framework.util.typeinference8.constraint.Constraint
Constraint.KindNested classes/interfaces inherited from interface org.checkerframework.framework.util.typeinference8.constraint.ReductionResult
ReductionResult.ReductionResultPair -
Field Summary
Fields inherited from interface org.checkerframework.framework.util.typeinference8.constraint.ReductionResult
UNCHECKED_CONVERSION -
Constructor Summary
ConstructorsConstructorDescriptionCreates a qualifier typing constraint. -
Method Summary
Modifier and TypeMethodDescriptionReturns the empty set: a qualifier constraint relates two qualifiers (Q <: RorQ = 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.getKind()Returns the kind of constraint.reduce(Java8InferenceContext context) Reduce this constraint what this means depends on the kind of constraint.toString()
-
Constructor Details
-
QualifierTyping
Creates a qualifier typing constraint.- Parameters:
Q- the qualifiers on the left-hand side of the constraintR- the qualifiers on the right-hand side of the constraintkind- the kind of qualifier constraint
-
-
Method Details
-
getKind
Description copied from interface:ConstraintReturns the kind of constraint.- Specified by:
getKindin interfaceConstraint- Returns:
- the kind of constraint
-
getInputVariables
Returns the empty set: a qualifier constraint relates two qualifiers (Q <: RorQ = 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:
getInputVariablesin interfaceConstraint- Returns:
- the empty set
-
reduce
Description copied from interface:ConstraintReduce 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:
reducein interfaceConstraint- Parameters:
context- Java8InferenceContext- Returns:
- the result of reducing this constraint
-
toString
-