diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-03-03 17:52:57 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-03-03 17:52:57 +0100 |
commit | 665d4ec2dac6734caff9de5b030be123cb7276ef (patch) | |
tree | 8a54555d485b23e8542fb6b19a612f749984f6bf /src/libexpr/eval.cc | |
parent | 1b2f5786d1bab73d40dc2c24f29cbdce057c6fe2 (diff) |
nix repl :doc: Don't return docs for partially applied primops
This gives misleading results for Nixpkgs functions like lib.toUpper.
Fixes #4596.
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r-- | src/libexpr/eval.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index e2f2308aa..3afe2e47b 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -592,10 +592,8 @@ Value & EvalState::getBuiltin(const string & name) std::optional<EvalState::Doc> EvalState::getDoc(Value & v) { - if (v.isPrimOp() || v.isPrimOpApp()) { + if (v.isPrimOp()) { auto v2 = &v; - while (v2->isPrimOpApp()) - v2 = v2->primOpApp.left; if (v2->primOp->doc) return Doc { .pos = noPos, |