code: private Expression tryToWrapInSoyExpression(Expression expr) {
      switch (expr.resultType().getSort()) {
        case Type.BOOLEAN:
          return SoyExpression.forBool(expr);
        case Type.INT:
          return SoyExpression.forInt(BytecodeUtils.numericConversion(expr, Type.LONG_TYPE));
        case Type.LONG:
          return SoyExpression.forInt(expr);
        case Type.DOUBLE:
          return SoyExpression.forFloat(expr);
        case Type.OBJECT:
          if (expr.resultType().equals(BytecodeUtils.STRING_TYPE)) {
            return SoyExpression.forString(expr);
          }
          break;
        default:
          break;
      }
      // TODO(sameb): Maybe wrap List/SoyValue types too, as 'unknown' parameter types?
      return expr;
    }
docs: Tries to wrap the Expression in a {@link SoyExpression}. We can only do this for types we
  statically know are Soy Expressions and don't require additional runtime type args.