Skip to content

functionArgs does not work with primop or primop-app #3624

@W95Psp

Description

@W95Psp

Describe the bug
functionArgs is not considering primps or primops applications as functions, and throws an uncatchable error.

Steps To Reproduce
For instance, lib.functionArgs map reduces to an error.

Expected behavior
functionArgs should return {}

nix-env --version output
nix-env (Nix) 2.3.4

Additional context
I guess this is just about adding an if statement there to handle primops:

nix/src/libexpr/primops.cc

Lines 1346 to 1350 in 25ed842

static void prim_functionArgs(EvalState & state, const Pos & pos, Value * * args, Value & v)
{
state.forceValue(*args[0], pos);
if (args[0]->type != tLambda)
throw TypeError(format("'functionArgs' requires a function, at %1%") % pos);

I'll post a PR, then.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions