-
Notifications
You must be signed in to change notification settings - Fork 745
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Prerequisites
- Check that your issue is not already filed:
https://github.com/leanprover/lean4/issues - Reduce the issue to a minimal, self-contained, reproducible test case.
Avoid dependencies to Mathlib or Batteries. - Test your test case against the latest nightly release, for example on
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
Plain text docstrings are allowed on declarations in a where clause, but Verso docstrings cause an error: "Unknown constant _ when building docstring". For example:
set_option doc.verso true
/-- This docstring works. -/
def foo := bar
where
/-- This docstring is not allowed:
-- error: Unknown constant foo.bar when building docstring
-/
bar := 37
-- But with Verso docs disabled:
set_option doc.verso false
/-- This docstring works. -/
def foo' := bar'
where
/-- This docstring now also works. -/
bar' := 37Context
Mathlib uses docstrings, rather than plain comments, to document the declarations in a where clause.
Steps to Reproduce
- Enable the option
doc.verso. - Write a
defwith awhereclause. - Add a declaration to that
whereclause. - Add a docstring to that declaration.
Expected behavior: The docstring does not throw any errors.
Actual behavior: There is an error "Unknown constant _ when building docstring".
Versions
Lean 4.27.0-rc1 (Mathlib, MacOS / Darwin Kernel Version 23.6.0 / arm64), Lean 4.28.0-nightly-2026-01-19 (Lean4web nightly)
Additional Information
n/a
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working