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
1 changed files with 1 additions and 3 deletions
|
@ -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 a new issue