Class 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 Detail

      • SubtypesSolver

        public SubtypesSolver()
    • 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 value
        constraints - 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.
      • 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.