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 <adam@westernsemico.com>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Adam Joseph 2023-12-12 02:58:18 -08:00 committed by clbot
parent 531f0c0c42
commit 012b44244b

View file

@ -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<Value, ErrorKind> {
Ok(Value::Catchable(CatchableErrorKind::UnimplementedFeature(
"hasContext".to_string(),
)))
}
#[builtin("head")]
async fn builtin_head(co: GenCo, list: Value) -> Result<Value, ErrorKind> {
match list.to_list()?.get(0) {