Class TargetType

java.lang.Object
com.google.errorprone.util.TargetType

public abstract class TargetType extends Object
An expression's target type, see targetType(VisitorState).
  • Constructor Details

    • TargetType

      public TargetType()
  • Method Details

    • targetType

      public static @Nullable TargetType targetType(VisitorState state)
      Returns the target type of the tree at the given VisitorState's path, or else null.

      For example, the target type of an assignment expression is the variable's type, and the target type of a return statement is the enclosing method's type.

      A general mental model is that the target type of an expression where the value is used is the highest supertype that you could cast to and still have this compile.

    • type

      public abstract com.sun.tools.javac.code.Type type()
    • path

      public abstract TreePath path()