diff options
author | Vincent Ambo <mail@tazj.in> | 2022-08-13T16·42+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-08-28T17·50+0000 |
commit | 2d401a32e5cef36b44fd35b12c58489cd2595f72 (patch) | |
tree | db3d8f3e64e72ef440f8811e09b94a2239cdf7e7 /tvix/eval/src/errors.rs | |
parent | 691a596aac0381d7794c6969cb9793131aa998f3 (diff) |
feat(tvix/eval): detect dynamic identifier names in `let` r/4523
Nix does not allow dynamic identifiers in let expressions (only in attribute sets), but there are several different kinds of things it considers static identifiers. The functions introduced here put the path components of a let expression into normalised (string) form, and surface an error about dynamic keys if one is encountered. Change-Id: Ia3ebd95c6f3ed3cd33b94e156930d2e9c39b6cbf Reviewed-on: https://cl.tvl.fyi/c/depot/+/6189 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'tvix/eval/src/errors.rs')
-rw-r--r-- | tvix/eval/src/errors.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs index d8c3ce41cc1d..a0e380822517 100644 --- a/tvix/eval/src/errors.rs +++ b/tvix/eval/src/errors.rs @@ -26,6 +26,9 @@ pub enum Error { // Resolving a user-supplied path literal failed in some way. PathResolution(String), + + // Dynamic keys are not allowed in let. + DynamicKeyInLet(rnix::SyntaxNode), } impl Display for Error { |