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

Wrong warning: Variable 'fields' is never used #210

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

Wrong warning: Variable 'fields' is never used #210

rillig opened this issue Oct 11, 2019 · 1 comment
Labels
bug help wanted Repo maintainer needs community help to fix this problem

Comments

@rillig
Copy link
Contributor

rillig commented Oct 11, 2019

wrong.warning <- function(key, values)
{
  fields <- list()
  for (l in values)
  {
    value <- unlist(l)
    if (value != '')
    fields <- append(fields, 'yes')
    else
    fields <- append(fields, 'no')
  }
  fields
}

image

The variable assignment in the then branch is marked as unused, but the one from the else branch isn't. That's inconsistent.

@holgerbrandl holgerbrandl added bug help wanted Repo maintainer needs community help to fix this problem labels Oct 20, 2019
@holgerbrandl
Copy link
Owner

Known issue, but I never found a good way to fix this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug help wanted Repo maintainer needs community help to fix this problem
Projects
None yet
Development

No branches or pull requests

2 participants