code: JCExpression cast(JCExpression tree, Type target) {
          int oldpos = make.pos;
          make.at(tree.pos);
          if (!types.isSameType(tree.type, target)) {
              if (!resolve.isAccessible(env, target.tsym))
                  resolve.logAccessErrorInternal(env, tree, target);
              tree = make.TypeCast(make.Type(target), tree).setType(target);
          }
          make.pos = oldpos;
          return tree;
      }
docs: Construct an attributed tree for a cast of expression to target type,
  unless it already has precisely that type.
  @param tree    The expression tree.
  @param target  The target type.