When abort() is called by a function that is called as an argument to another function, $call does not have a "srcref" attribute and the error does not display the source location.
Compare the output of g1() and g2() in this example:
options(rlang_backtrace_on_error = "none")
script <- tempfile(fileext = ".R")
cat('
f <- function() {
abort("Something\'s wrong...")
}
g1 <- function() {
f()
}
g2 <- function() {
identity(f())
}
', file = script)
source(script)
g1()
#> Error in `f()` at /Rtmp5iDn8E/file8ae03bd8bd93.R:7:3:
#> ! Something's wrong...
g2()
#> Error in `f()`:
#> ! Something's wrong...
This seems to be a limitation in how R does not preserve source references for promise expressions:
h <- \() sys.call() %@% srcref
(\() h())()
#> \() h()
(\() identity(h()))()
#> NULL