From 012b44244bd75ad3480141debda6011370195c2b Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 12 Dec 2023 02:58:18 -0800 Subject: feat(tvix/eval): builtins.hasContext: placeholder implementation Currently this just `throw`s a message explaining that it is not implemented. This is necessary in order to allow enumerating the nixpkgs release attrset (afaict only one package uses this builtin). Change-Id: I45266d46af579ddb5856b192b6be4b481369543c Reviewed-on: https://cl.tvl.fyi/c/depot/+/10302 Autosubmit: Adam Joseph Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/eval/src/builtins/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tvix/eval') diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 181ddeed82e8..b7649e7995ed 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -498,6 +498,14 @@ mod pure_builtins { Ok(Value::Bool(xs.contains(k.as_str()))) } + #[builtin("hasContext")] + #[allow(non_snake_case)] + async fn builtin_hasContext(_co: GenCo, #[lazy] _e: Value) -> Result { + Ok(Value::Catchable(CatchableErrorKind::UnimplementedFeature( + "hasContext".to_string(), + ))) + } + #[builtin("head")] async fn builtin_head(co: GenCo, list: Value) -> Result { match list.to_list()?.get(0) { -- cgit 1.4.1