Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False postive UnneededRec with nested attribute sets #43

Open
nothingelsematters opened this issue Oct 13, 2020 · 1 comment
Open

False postive UnneededRec with nested attribute sets #43

nothingelsematters opened this issue Oct 13, 2020 · 1 comment

Comments

@nothingelsematters
Copy link

Example:

rec {
  a = {
    a-b = "a - b";
  };
  c = {
    c-d = a.a-b;
  };
}

It is treated as unneeded rec now

I need this rec here, because otherwise it results in:
undefined variable 'a' at ...

@avdv
Copy link

avdv commented May 2, 2022

Here is another example which triggers this false positive:

rec {
  defaultApp = 1;
  apps.default = defaultApp;

  devShell =  2;
  devShells.default = devShell;
}

results in Unneeded 'rec' on set at fp.nix:1:1-7:2.

Interestingly, if one comments out either the apps.default or devShells.default line the error is gone.

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

No branches or pull requests

2 participants