Skip to content
This repository has been archived by the owner on Oct 25, 2019. It is now read-only.

Inlining a function call produces wrong code #215

Open
rillig opened this issue Oct 12, 2019 · 1 comment
Open

Inlining a function call produces wrong code #215

rillig opened this issue Oct 12, 2019 · 1 comment
Labels

Comments

@rillig
Copy link
Contributor

rillig commented Oct 12, 2019

find.Rcpp <- function(s1, s2)
{
  s <- paste(s1, s2)
  grepl('Rcpp', s)
}

Place the cursor at the s variable and press Alt+Enter, inline.

Expected: The expression paste(s1, s2) is moved.
Actual: After moving, the expression is only paste, without the function call and the arguments.

find.Rcpp <- function(s1, s2)
{

  grepl('Rcpp', paste)
}

Probably related: inlining the expression i + 1 only copies the i; the + 1 is lost.

@holgerbrandl
Copy link
Owner

I guess, inlining became possible as an unwanted (and thus untested) side effect.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants