nixir/tests/inherit.nix
NotAShelf 49f64c9c98
tests: initial test suite for IR compiler
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I70cd1dfa45add9df58a44add69fbd30a6a6a6964
2026-02-22 00:07:44 +03:00

17 lines
252 B
Nix

# Test inherit keyword
let
x = 10;
y = 20;
attrs = { a = 1; b = 2; c = 3; };
in
{
# Basic inherit from outer scope
inherit x y;
# Inherit from expression
inherit (attrs) a b;
# Mixed
z = 30;
inherit (attrs) c;
}