-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11560 from rhendric/rhendric/deprecate-cursed-or
libexpr: deprecate the bogus "or"-as-variable
- Loading branch information
Showing
6 changed files
with
79 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/functional/lang/eval-okay-deprecate-cursed-or.err.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
warning: at /pwd/lang/eval-okay-deprecate-cursed-or.nix:3:47: This expression uses `or` as an identifier in a way that will change in a future Nix release. | ||
Wrap this entire expression in parentheses to preserve its current meaning: | ||
((x: x) or) | ||
Give feedback at https://github.com/NixOS/nix/pull/11121 | ||
warning: at /pwd/lang/eval-okay-deprecate-cursed-or.nix:4:39: This expression uses `or` as an identifier in a way that will change in a future Nix release. | ||
Wrap this entire expression in parentheses to preserve its current meaning: | ||
((x: x + 1) or) | ||
Give feedback at https://github.com/NixOS/nix/pull/11121 | ||
warning: at /pwd/lang/eval-okay-deprecate-cursed-or.nix:5:44: This expression uses `or` as an identifier in a way that will change in a future Nix release. | ||
Wrap this entire expression in parentheses to preserve its current meaning: | ||
((x: x) or) | ||
Give feedback at https://github.com/NixOS/nix/pull/11121 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
let | ||
# These are cursed and should warn | ||
cursed0 = builtins.length (let or = 1; in [ (x: x) or ]); | ||
cursed1 = let or = 1; in (x: x * 2) (x: x + 1) or; | ||
cursed2 = let or = 1; in { a = 2; }.a or (x: x) or; | ||
|
||
# These are uses of `or` as an identifier that are not cursed | ||
allowed0 = let or = (x: x); in map or []; | ||
allowed1 = let f = (x: x); or = f; in f (f or); | ||
in | ||
0 |