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

types: remove loeOf #30135

Merged
merged 1 commit into from Oct 5, 2017
Merged

types: remove loeOf #30135

merged 1 commit into from Oct 5, 2017

Conversation

4z3
Copy link
Contributor

@4z3 4z3 commented Oct 5, 2017

Motivation for this change

loeOf isn't used anywhere in nixpkgs and it's broken. In particular it doesn't support element of type X:

$ nix-instantiate --eval -E 'with import <nixpkgs/lib>; (evalModules {
  modules = singleton { 
    options.derp = mkOption { 
      type = types.loeOf types.int;
      default = 23;
    };
  };
}).config.derp'
error: The option `derp' does not have a string value, in `<unknown-file>'.

The type could probably be fixed by replacing isString with elemType.check, but then, it's better to have less code, right? :)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@4z3 4z3 requested a review from edolstra as a code owner October 5, 2017 19:20
@orivej
Copy link
Contributor

orivej commented Oct 5, 2017

If you tried to use that function, don't you want it to be fixed rather than removed?

@4z3
Copy link
Contributor Author

4z3 commented Oct 5, 2017

I don't have a use for that type, I've just encountered it.

@orivej
Copy link
Contributor

orivej commented Oct 5, 2017

As can be seen here 1fe1cde , this function was deprecated in favor of either type (listOf type).

@4z3
Copy link
Contributor Author

4z3 commented Oct 5, 2017

Thanks for digging up the reference!

@orivej orivej merged commit 10881bb into NixOS:master Oct 5, 2017
@4z3 4z3 deleted the kill-loeOf branch October 5, 2017 21:00
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

Successfully merging this pull request may close these issues.

None yet

2 participants