Class SubtypesSolver
- java.lang.Object
-
- org.checkerframework.framework.util.typeinference.solver.SubtypesSolver
-
public class SubtypesSolver extends java.lang.Object
Infers type arguments by using the Greatest Lower Bound computation on the subtype relationships in a constraint map.
-
-
Constructor Summary
Constructors Constructor Description SubtypesSolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InferenceResult
glbSubtypes(java.util.Set<javax.lang.model.type.TypeVariable> remainingTargets, ConstraintMap constraints, AnnotatedTypeFactory typeFactory)
protected static void
propagatePreviousGlbs(TargetConstraints.Subtypes targetSubtypes, InferenceResult solution, java.util.Map<AnnotatedTypeMirror,AnnotationMirrorSet> subtypesOfTarget)
/** If the target corresponding to targetRecord must be a subtype of another target for which we have already determined a GLB, add that target's GLB to the list of subtypes to be GLBed for this target.InferenceResult
solveFromSubtypes(java.util.Set<javax.lang.model.type.TypeVariable> remainingTargets, ConstraintMap constraints, AnnotatedTypeFactory typeFactory)
Infers type arguments using subtype constraints.
-
-
-
Method Detail
-
solveFromSubtypes
public InferenceResult solveFromSubtypes(java.util.Set<javax.lang.model.type.TypeVariable> remainingTargets, ConstraintMap constraints, AnnotatedTypeFactory typeFactory)
Infers type arguments using subtype constraints.- Parameters:
remainingTargets
- targets for which we still need to infer a valueconstraints
- the set of constraints for all targets- Returns:
- a mapping from target to inferred type. Note this class always infers concrete types and will not infer that the target is equivalent to another target.
-
glbSubtypes
public InferenceResult glbSubtypes(java.util.Set<javax.lang.model.type.TypeVariable> remainingTargets, ConstraintMap constraints, AnnotatedTypeFactory typeFactory)
-
propagatePreviousGlbs
protected static void propagatePreviousGlbs(TargetConstraints.Subtypes targetSubtypes, InferenceResult solution, java.util.Map<AnnotatedTypeMirror,AnnotationMirrorSet> subtypesOfTarget)
/** If the target corresponding to targetRecord must be a subtype of another target for which we have already determined a GLB, add that target's GLB to the list of subtypes to be GLBed for this target.
-
-