1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 23:03:53 -04:00
nix/tests/unit
Eelco Dolstra 8c0590fa32 Never update values after setting the type
Thunks are now overwritten by a helper function
`Value::finishValue(newType, payload)` (where `payload` is the
original anonymous union inside `Value`). This helps to ensure we
never update a value elsewhere, since that would be incompatible with
parallel evaluation (i.e. after a value has transitioned from being a
thunk to being a non-thunk, it should be immutable).

There were two places where this happened: `Value::mkString()` and
`ExprAttrs::eval()`.

This PR also adds a bunch of accessor functions for value contents,
like `Value::integer()` to access the integer field in the union.
2024-03-25 19:21:25 +01:00
..
libexpr Never update values after setting the type 2024-03-25 19:21:25 +01:00
libexpr-support Never update values after setting the type 2024-03-25 19:21:25 +01:00
libstore Ban building Nix with NDEBUG 2024-03-02 11:22:46 -08:00
libstore-support test: Generate distinct path names 2024-01-31 18:35:19 +01:00
libutil Support symlinks properly with git-hashing experimental feature 2024-02-28 12:24:45 -05:00
libutil-support test: Generate distinct hashes 2024-01-31 18:35:19 +01:00