Skip to content

object_usage_linter() misses functions defined with \(x) lambda #1933

Closed
@MichaelChirico

Description

@MichaelChirico
lintr::lint("f <- \\() x\n", lintr::object_usage_linter())
lintr::lint("f <- function() x\n", lintr::object_usage_linter())
# Warning message:
# In parse_check_usage(fun, known_used_symbols = known_used_symbols,  :
#   Possible bug in lintr: Couldn't parse usage message ‘<anonymous>: no visible binding for global variable 'x'
# ’. Ignoring 1 usage warnings.

(the warning in the second case is #1917)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions