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

builtins contains itself recursively #7289

Closed
fricklerhandwerk opened this issue Nov 11, 2022 · 3 comments
Closed

builtins contains itself recursively #7289

fricklerhandwerk opened this issue Nov 11, 2022 · 3 comments
Labels
language The Nix expression language; parser, interpreter, primops, evaluation, etc question

Comments

@fricklerhandwerk
Copy link
Contributor

fricklerhandwerk commented Nov 11, 2022

Describe the bug

builtins contains itself, recursively.

This seems unintentional?

Steps To Reproduce

nix-repl> builtins.builtins.builtins == builtins
true

Expected behavior

nix-repl> builtins.builtins
error: attribute 'builtins' missing

       at «string»:1:1:

            1| builtins.builtins
             | ^

nix-env --version output

nix (Nix) 2.11.0

Additional context

@fricklerhandwerk fricklerhandwerk added bug language The Nix expression language; parser, interpreter, primops, evaluation, etc labels Nov 11, 2022
@infinisil
Copy link
Member

It kinda makes sense, builtins itself is a builtin value, so it should be in builtins, therefore builtins.builtins. But I can neither think of a valid use case for this nor a problem that would be caused by this.

@aakropotkin
Copy link
Contributor

I want to find a use case for this. Is this related to scopedImport at all?

@edolstra edolstra removed the bug label Nov 18, 2022
@roberth
Copy link
Member

roberth commented Mar 29, 2023

It has existed for a long time, so it's not worth breaking someone's expression over what seems to be aesthetics, it is unlikely to cause problems and

It kinda makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language The Nix expression language; parser, interpreter, primops, evaluation, etc question
Projects
None yet
Development

No branches or pull requests

5 participants