Skip to content

checkUsage doesn't find "no visible binding for global variable" in some contexts

I expect the following two functions to return "no visible binding for global variable 'foo'" messages when run through checkUsage:

f1 <- function() {
  foo$bar
}
f2 <- function() {
  dim(foo) <- 2L
}

neither of them produce a usage warning.

Found during the debugging of https://github.com/jimhester/lintr/pull/709.