Fix lix warnings for using "or" as an identifier
> warning: using or as an identifier is deprecated because it cannot be > used in most places (try let or = 1; in or). Use > --extra-deprecated-features or-as-identifier to disable this warning. This is a bit of a hack, using quotes to silence the warning for now. It does *work*, but only in places where it's not ambiguous anyways. Long term, we should come up with a different name that doesn't conflict with a keyword.
This commit is contained in:
parent
06b458ea7a
commit
ac64c30345
3 changed files with 6 additions and 6 deletions
|
|
@ -44,7 +44,7 @@ lib: {
|
|||
/**
|
||||
Perform a logical OR operation on two values.
|
||||
*/
|
||||
or = a: b: a || b;
|
||||
"or" = a: b: a || b;
|
||||
|
||||
/**
|
||||
Perform a logical OR operation on two functions being applied to a value.
|
||||
|
|
|
|||
|
|
@ -117,25 +117,25 @@ in
|
|||
"returns true when both are true" =
|
||||
let
|
||||
expected = true;
|
||||
actual = lib.bools.or true true;
|
||||
actual = lib.bools."or" true true;
|
||||
in
|
||||
actual == expected;
|
||||
"returns true when first is true" =
|
||||
let
|
||||
expected = true;
|
||||
actual = lib.bools.or true false;
|
||||
actual = lib.bools."or" true false;
|
||||
in
|
||||
actual == expected;
|
||||
"returns true when second is true" =
|
||||
let
|
||||
expected = true;
|
||||
actual = lib.bools.or false true;
|
||||
actual = lib.bools."or" false true;
|
||||
in
|
||||
actual == expected;
|
||||
"returns false when both are false" =
|
||||
let
|
||||
expected = false;
|
||||
actual = lib.bools.or false false;
|
||||
actual = lib.bools."or" false false;
|
||||
in
|
||||
actual == expected;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ lib: {
|
|||
mergedFunctions = x: lib.options.mergeDefault location (builtins.map (f: f x) values);
|
||||
mergedLists = builtins.concatLists values;
|
||||
mergedAttrs = builtins.foldl' lib.attrs.merge { } values;
|
||||
mergedBools = builtins.any lib.bools.or false values;
|
||||
mergedBools = builtins.any lib.bools."or" false values;
|
||||
mergedStrings = lib.strings.concat values;
|
||||
in
|
||||
if builtins.length values == 1 then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue