code: private static JSType getTypeBeforeCast(Node node) {
      JSType typeBeforeCast = node.getJSTypeBeforeCast();
      // might still return null if node.getJSType() is null (i.e. typechecking hasn't run)
      return typeBeforeCast != null ? typeBeforeCast : node.getJSType();
    }
docs: Returns the node's pre-CAST type, if is has one. Otherwise just returns node.getJSType()