Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Infoview popup shows partially instantiated type

Open
#517 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
lua
Domain
devtools, tooling

Research direction

Reproduce the issue at commit 3089040359942d58d70af5deaac1bbe63724c53a by opening Examples.lean and pressing K over traverseChildren at line 525. Compare the infoview output with the reported VSCode output, then trace the infoview type display path. Done means the popup preserves the generic function signature instead of showing an instantiated return type.

Written by the indexing model from the issue text.

Description

I am on https://github.com/Julian/lean.nvim/commit/3089040359942d58d70af5deaac1bbe63724c53a -- the latest revision available.

This is the project: https://github.com/AeneasVerif/kraken/tree/fd2b8f6b0761f51623c0fe62b83e85d36db8155a

Opening Examples.lean then hitting K over traverseChildren at line 525 shows the following infoview:

Lean.Meta.traverseChildren.{u_1} {M : Type → Type u_1} [Monad M] [MonadLiftT MetaM M] [MonadControlT MetaM M]
  (visit : Expr → M Expr) (e : Expr) : StateRefT' IO.RealWorld Bool SymM Expr

Maps `visit` on each child of the given expression.

Applications, foralls, lambdas and let binders are bundled (as they are bundled in `Expr.traverseApp`, `traverseForall`, ...).
So `traverseChildren f e` where ``e = `(fn a₁ ... aₙ)`` will return
``(← f `(fn)) (← f `(a₁)) ... (← f `(aₙ))`` rather than ``(← f `(fn a₁ ... aₙ₋₁)) (← f `(aₙ))``

See also `Lean.Core.traverseChildren`.

Note how the type that is shown starts as the type of the definition (with proper type classes), but the return type of the function shows an instantiated type where M has been replaced with a concrete instance. The type should be the generic type of the function signature.

This does not happen on VSCode (@kha sent a screenshot of VSCode's output)

Image
Dominant language
Lua
Stars
601
Forks
61
Avg merge
3d 14h
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Julian/lean.nvim

All issues in Julian/lean.nvim

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.