summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2020-01-23 01:07:02 +0100
committerProfpatsch <mail@profpatsch.de>2020-01-23 14:47:38 +0100
commit18520b7f3658f2007c7cbfcaea43edf2becdbb86 (patch)
treed9ea38396e88e41988b62dd5dabd2392982bb6a3 /lib
parente71e1be8590e0f0dcac66e8b1e09695b94362fbd (diff)
downloadnixpkgs-18520b7f3658f2007c7cbfcaea43edf2becdbb86.tar
nixpkgs-18520b7f3658f2007c7cbfcaea43edf2becdbb86.tar.gz
nixpkgs-18520b7f3658f2007c7cbfcaea43edf2becdbb86.tar.bz2
nixpkgs-18520b7f3658f2007c7cbfcaea43edf2becdbb86.tar.lz
nixpkgs-18520b7f3658f2007c7cbfcaea43edf2becdbb86.tar.xz
nixpkgs-18520b7f3658f2007c7cbfcaea43edf2becdbb86.tar.zst
nixpkgs-18520b7f3658f2007c7cbfcaea43edf2becdbb86.zip
lib/generators: floats are not supported in mkValueStringDefault
They are cut off after a few decimal places; we cannot in good faith
define a default string representation with that.
Diffstat (limited to 'lib')
-rw-r--r--lib/generators.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/generators.nix b/lib/generators.nix
index a71654bec6c..a64e94bd5cb 100644
--- a/lib/generators.nix
+++ b/lib/generators.nix
@@ -46,7 +46,10 @@ rec {
     else if isList     v then err "lists" v
     # same as for lists, might want to replace
     else if isAttrs    v then err "attrsets" v
+    # functions can’t be printed of course
     else if isFunction v then err "functions" v
+    # let’s not talk about floats. There is no sensible `toString` for them.
+    else if isFloat    v then err "floats" v
     else err "this value is" (toString v);