java.lang.Object
org.checkerframework.framework.util.typeinference8.InferenceResult

public class InferenceResult extends Object
The result of type argument inferrece.
  • Constructor Details

    • InferenceResult

      public InferenceResult(Collection<Variable> variables, boolean uncheckedConversion, boolean annoInferenceFailed, String errorMsg)
      Creates an inference result.
      Parameters:
      variables - instantiated variables
      uncheckedConversion - where unchecked conversion was required to infer the type arguments
      annoInferenceFailed - whether inference failed because of annotations
      errorMsg - message to report to users if inference failed
  • Method Details

    • emptyResult

      public static InferenceResult emptyResult()
      Returns an empty inference result.
      Returns:
      an empty inference result
    • getResults

      public Map<Tree,Map<TypeVariable,AnnotatedTypeMirror>> getResults()
      A mapping from a tree that needs type argument inference to a map from type parameter to its inferred annotated type argument. If inference failed, this map will be empty.
      Returns:
      mapping from a tree that needs type argument inference to a map from type parameter to its inferred annotated type argument
    • isUncheckedConversion

      public boolean isUncheckedConversion()
      Whether unchecked conversion was necessary to infer the type arguments.
      Returns:
      whether unchecked conversion was necessary to infer the type arguments
    • inferenceFailed

      public boolean inferenceFailed()
      Whether type argument inference failed because an annotated type could not be inferred.
      Returns:
      Whether type argument inference failed because an annotated type could not be inferred
    • getTypeArgumentsForExpression

      public Map<TypeVariable,AnnotatedTypeMirror> getTypeArgumentsForExpression(ExpressionTree expressionTree)
      Returns a mapping from type variable to its type argument for the expressionTree.
      Parameters:
      expressionTree - a tree for which type arguments were inferred
      Returns:
      a mapping from type variable to its type argument for the expressionTree
    • getErrorMsg

      public String getErrorMsg()
      An error message to report to the user.
      Returns:
      an error message to report to the user