public class SubtypesSolver extends Object
Infers type arguments by using the Greatest Lower Bound computation on the subtype relationships in a constraint map.
  • Constructor Details

    • SubtypesSolver

      public SubtypesSolver()
  • Method Details

    • solveFromSubtypes

      public InferenceResult solveFromSubtypes(Set<TypeVariable> remainingTargets, ConstraintMap constraints, AnnotatedTypeFactory typeFactory)
      Infers type arguments using subtype constraints.
      remainingTargets - targets for which we still need to infer a value
      constraints - the set of constraints for all targets
      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(Set<TypeVariable> remainingTargets, ConstraintMap constraints, AnnotatedTypeFactory typeFactory)
    • propagatePreviousGlbs

      protected static void propagatePreviousGlbs(TargetConstraints.Subtypes targetSubtypes, InferenceResult solution, 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.