Skip to content

fix: withoutExporting around diagnostic reporting#13630

Open
kim-em wants to merge 1 commit intoleanprover:masterfrom
kim-em:issue-13581
Open

fix: withoutExporting around diagnostic reporting#13630
kim-em wants to merge 1 commit intoleanprover:masterfrom
kim-em:issue-13581

Conversation

@kim-em
Copy link
Copy Markdown
Collaborator

@kim-em kim-em commented May 4, 2026

This PR fixes an "Unknown constant" error when set_option diagnostics true is enabled in module mode under a public section. Diagnostic output may reference private declarations such as _match_* and _sparseCasesOn_* that are recorded in unfold counters; constructing the message previously failed because the environment was in exporting mode and could not resolve those names. The diagnostic-printing paths in Lean.Meta.Diagnostics.reportDiag and Lean.Meta.Tactic.Simp.Diagnostics.reportDiag now run under withoutExporting.

Closes #13581.

🤖 Prepared with Claude Code

This PR fixes an "Unknown constant" error when `set_option diagnostics
true` is enabled in module mode under a `public section`. Diagnostic
output may reference private declarations such as `_match_*` and
`_sparseCasesOn_*` that are recorded in unfold counters; constructing
the message previously failed because the environment was in exporting
mode and could not resolve those names. The diagnostic-printing paths
in `Lean.Meta.Diagnostics.reportDiag` and
`Lean.Meta.Tactic.Simp.Diagnostics.reportDiag` now run under
`withoutExporting`.

Closes leanprover#13581.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kim-em kim-em requested a review from leodemoura as a code owner May 4, 2026 13:02
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label May 4, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase ba502f7027ca6a413b913265ca0d592f1c6e4d07 --onto dae325700c89e23c453b1d6d5ed5432d87880062. You can force Mathlib CI using the force-mathlib-ci label. (2026-05-04 13:53:59)

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase ba502f7027ca6a413b913265ca0d592f1c6e4d07 --onto 3fc99eef102549c743c6c63547983319bfae6f01. You can force reference manual CI using the force-manual-ci label. (2026-05-04 13:54:01)

@Kha Kha added this pull request to the merge queue May 5, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-other toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

set_option diagnostics true fails with 'Unknown constant' on private _sparseCasesOn_* / match_* helpers in module mode

2 participants