# make sure we can access variables that are not in fun lexical scope

Error in get("zfqwefkj") : object 'zfqwefkj' not found

local({
    zfqwefkj <- 200L
    fun8b(zfqwefkj)
})

fun <- function(x) {
    a <- quote(all(. > 0))
    b <- quote(is.vector(.))
    vetr(a && b)
    TRUE
}

For argument `x`, `all(-(1:3) > 0)` is not TRUE (FALSE)

Error in fun(x = -(1:3)) : 
  For argument `x`, `all(-(1:3) > 0)` is not TRUE (FALSE)

fun8 <- function(x = "hello", y = TRUE, z) vetr(x = integer(), 
    z = integer(2L))

For argument `z`, `NULL` should be type "integer-like" (is "NULL")

Error in fun8(x = 1L, y = 1:2, z = NULL) : 
  For argument `z`, `NULL` should be type "integer-like" (is "NULL")

argument `z` is missing, with no default

Error in fun8(x = 1L, y = 1:2) : argument `z` is missing, with no default

Error in fun8(x = 1L) : argument `z` is missing, with no default

For argument `x`, `"hello"` should be type "integer-like" (is "character")

Error in fun8(z = 1:2) : 
  For argument `x`, `"hello"` should be type "integer-like" (is "character")

fun1 <- function(x, y) vetr(x > 0, . < 3)

vet/vetr usage error: found symbol `x` in vetting token for object with the same symbol.  Please use `.` to reference the object being checked by the vetting token (e.g. use `vet(. > 0, x)` instead of `vet(x > 0, x)`)

Error in vetr(x > 0, . < 3) : 
  vet/vetr usage error: found symbol `x` in vetting token for object with the same symbol.  Please use `.` to reference the object being checked by the vetting token (e.g. use `vet(. > 0, x)` instead of `vet(x > 0, x)`)

fun2 <- function(x, y) vetr(. > 0 && all(y > 0), y < 3)

vet/vetr usage error: found symbol `y` in vetting token for object with the same symbol.  Please use `.` to reference the object being checked by the vetting token (e.g. use `vet(. > 0, x)` instead of `vet(x > 0, x)`)

Error in vetr(. > 0 && all(y > 0), y < 3) : 
  vet/vetr usage error: found symbol `y` in vetting token for object with the same symbol.  Please use `.` to reference the object being checked by the vetting token (e.g. use `vet(. > 0, x)` instead of `vet(x > 0, x)`)