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

Quotes should be allowed after inherit #97

Closed
nagy opened this issue Apr 17, 2022 · 2 comments · Fixed by #141
Closed

Quotes should be allowed after inherit #97

nagy opened this issue Apr 17, 2022 · 2 comments · Fixed by #141
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nagy
Copy link
Member

nagy commented Apr 17, 2022

Consider this default.nix file:

rec {
  first."hello/there" = 123;
  second = { inherit (first) "hello/there"; };
}

It is valid:

$ nix-instantiate --eval default.nix -A second.hello/there
123

But with nixfmt, I get:

$ nixfmt default.nix
default.nix:3:30:
  |
3 |   second = { inherit (first) "hello/there"; };
  |                              ^
unexpected '"'
expecting expression
@yorickvP yorickvP added this to the 0.6 milestone Apr 18, 2022
@yorickvP yorickvP added the bug Something isn't working label Apr 18, 2022
@nagy
Copy link
Member Author

nagy commented Apr 29, 2022

I have found a very similar issue to this one. Dollar-sign after inherit:

rec {
  first.${"hello"} = 123;
  second = { inherit (first) ${"hello"}; };
}
$ nixfmt default.nix
default.nix:3:30:
  |
3 |   second = { inherit (first) ${"hello"}; };
  |                              ^
unexpected '$'
expecting expression

@Enzime
Copy link
Member

Enzime commented May 29, 2023

Another example:

rec {
  first."hello.there" = 123;
  second = { inherit (first) "hello.there"; };
}
default.nix:3:30:
  |
3 |   second = { inherit (first) "hello.there"; };
  |                              ^
unexpected '"'
expecting expression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants