Skip to content

Splicing into { should zap srcref #1821

@lionel-

Description

@lionel-

The srcrefs on { should be removed (or adjusted) if there's a !!! splice because they won't match the length of the { call, breaking assumptions.

expr({ !!!body })

Example of R CMD check issue stemming from this:

* checking R code for possible problems ... NOTE
Error: Error in attr(e, "srcref")[[i]] : subscript out of bounds
Calls: <Anonymous> ... <Anonymous> -> collectUsage -> collectUsageFun -> walkCode -> h
Execution halted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions