Class Expression
java.lang.Object
org.checkerframework.framework.util.typeinference8.constraint.TypeConstraint
org.checkerframework.framework.util.typeinference8.constraint.Expression
- All Implemented Interfaces:
Constraint,ReductionResult
<Expression → T> An expression is compatible in a loose invocation context with type T
-
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 class org.checkerframework.framework.util.typeinference8.constraint.TypeConstraint
parent, source, TFields inherited from interface org.checkerframework.framework.util.typeinference8.constraint.ReductionResult
UNCHECKED_CONVERSION -
Constructor Summary
ConstructorsConstructorDescriptionExpression(String source, ExpressionTree expressionTree, AbstractType t) Creates an expression constraint.Expression(Constraint parent, ExpressionTree expressionTree, AbstractType t) Creates an expression constraint. -
Method Summary
Modifier and TypeMethodDescriptionbooleanFor lambda and method references constraints, input variables are roughly the inference variables mentioned by they function type's parameter types and return types.getKind()Return the kind of constraint."The output variables of [expression] constraints are all inference variables mentioned by the type on the right-hand side of the constraint, T, that are not input variables."inthashCode()reduce(Java8InferenceContext context) Reduce this constraint what this means depends on the kind of constraint.toString()Methods inherited from class org.checkerframework.framework.util.typeinference8.constraint.TypeConstraint
applyInstantiations, constraintHistory, getInferenceVariables, getInputVariablesForExpression, getT
-
Constructor Details
-
Expression
Creates an expression constraint.- Parameters:
parent- the constraint whose reduction created this constraintexpressionTree- the expression for the constraintt- the type that the expression is compatible in a loose invocation context
-
Expression
Creates an expression constraint.- Parameters:
source- a string describing where this constraint came fromexpressionTree- the expression for the constraintt- the type that the expression is compatible in a loose invocation context
-
-
Method Details
-
getKind
Description copied from interface:ConstraintReturn the kind of constraint.- Returns:
- the kind of constraint
-
getInputVariables
Description copied from class:TypeConstraintFor lambda and method references constraints, input variables are roughly the inference variables mentioned by they function type's parameter types and return types. For conditional expression constraints and switch expression constraints, input variables are the union of the input variables of its subexpressions. For all other constraints, no input variables exist.Defined in JLS section 18.5.2.2
- Specified by:
getInputVariablesin classTypeConstraint- Returns:
- input variables for this constraint
-
getOutputVariables
Description copied from class:TypeConstraint"The output variables of [expression] constraints are all inference variables mentioned by the type on the right-hand side of the constraint, T, that are not input variables."As defined in JLS section 18.5.2.2
- Specified by:
getOutputVariablesin classTypeConstraint- Returns:
- output variables for this constraint
-
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
- Parameters:
context- Java8InferenceContext- Returns:
- the result of reducing this constraint
-
toString
-
equals
- Overrides:
equalsin classTypeConstraint
-
hashCode
public int hashCode()- Overrides:
hashCodein classTypeConstraint
-