mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 14:52:55 +00:00
nix repl :doc: Don't return docs for partially applied primops
This gives misleading results for Nixpkgs functions like lib.toUpper. Fixes #4596.
This commit is contained in:
parent
1b2f5786d1
commit
665d4ec2da
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user