Interface Constraint
- All Superinterfaces:
ReductionResult
- All Known Implementing Classes:
AdditionalArgument,CheckedExceptionConstraint,Expression,QualifierTyping,TypeConstraint,Typing
A constraint. See JLS.
-
Nested Class Summary
Nested ClassesNested 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 -
Method Summary
Modifier and TypeMethodDescriptionReturns the input variables of this constraint: the inference variables that must be resolved before this constraint may be reduced.getKind()Returns the kind of constraint.reduce(Java8InferenceContext context) Reduce this constraint what this means depends on the kind of constraint.
-
Method Details
-
getKind
Constraint.Kind getKind()Returns the kind of constraint.- Returns:
- the kind of constraint
-
reduce
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
- Parameters:
context- Java8InferenceContext- Returns:
- the result of reducing this constraint
-
getInputVariables
Returns the input variables of this constraint: the inference variables that must be resolved before this constraint may be reduced.For lambda, method reference, and additional-argument constraints, input variables are roughly the inference variables mentioned by the target function type's parameter types. For conditional expression constraints and switch expression constraints, input variables are the union of the input variables of their subexpressions. For all other constraints, no input variables exist.
Defined in JLS section 18.5.2.2. (
Constraint.Kind.ADDITIONAL_ARGconstraints are this implementation's own addition, not a JLS-defined constraint kind, but they need the same ordering treatment: seeAdditionalArgument.)Callers that need to mutate the result should make a defensive copy first.
- Returns:
- the input variables of this constraint
-