Class TypeConstraint
java.lang.Object
org.checkerframework.framework.util.typeinference8.constraint.TypeConstraint
- All Implemented Interfaces:
Constraint
,ReductionResult
- Direct Known Subclasses:
CheckedExceptionConstraint
,Expression
,Typing
Constraints are between either an expression and a type, two types, or an expression and a thrown
type. Defined in JLS section
18.1.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.checkerframework.framework.util.typeinference8.constraint.Constraint
Constraint.Kind
Nested classes/interfaces inherited from interface org.checkerframework.framework.util.typeinference8.constraint.ReductionResult
ReductionResult.ReductionResultPair
-
Field Summary
Modifier and TypeFieldDescriptionprotected AbstractType
T, the type on the right hand side of the constraint; may contain inference variables.Fields inherited from interface org.checkerframework.framework.util.typeinference8.constraint.ReductionResult
UNCHECKED_CONVERSION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply the given instantiations to any type mentioned in this constraint -- meaning replace any mention of a variable ininstantiations
with its proper type.boolean
Returns a collection of all inference variables mentioned by this constraint.For lambda and method references constraints, input variables are roughly the inference variables mentioned by they function type's parameter types and return types.Implementation ofgetInputVariables()
that is used both by expressions constraints and checked exception constraints https://docs.oracle.com/javase/specs/jls/se8/html/jls-18.html#jls-18.5.2-200"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."getT()
Returns T which is the type on the right hand side of the constraint.int
hashCode()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.checkerframework.framework.util.typeinference8.constraint.Constraint
getKind, reduce
-
Field Details
-
T
T, the type on the right hand side of the constraint; may contain inference variables.
-
-
Constructor Details
-
TypeConstraint
Creates a type constraint- Parameters:
T
- the type of the right hand side of the constraint
-
-
Method Details
-
getT
Returns T which is the type on the right hand side of the constraint.- Returns:
- T, that is the type on the right hand side of the constraint
-
getInferenceVariables
Returns a collection of all inference variables mentioned by this constraint.- Returns:
- a collection of all inference variables mentioned by this constraint
-
getInputVariables
For 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
- Returns:
- input variables for this constraint
-
getOutputVariables
"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
- Returns:
- output variables for this constraint
-
getInputVariablesForExpression
Implementation ofgetInputVariables()
that is used both by expressions constraints and checked exception constraints https://docs.oracle.com/javase/specs/jls/se8/html/jls-18.html#jls-18.5.2-200- Parameters:
tree
- an expression treeT
- the type of the right hand side of the constraint- Returns:
- the input variables for this constraint
-
applyInstantiations
public void applyInstantiations()Apply the given instantiations to any type mentioned in this constraint -- meaning replace any mention of a variable ininstantiations
with its proper type. -
equals
-
hashCode
public int hashCode()
-