-
Notifications
You must be signed in to change notification settings - Fork 723
Open
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
When using declare_syntax_cat in a private section of a module, importing the module fails with an "unknown constant" error.
Steps to Reproduce
- Check out the Lake project in this branch: https://github.com/datokrat/lean-bug-reproductions/tree/bugs8
- Open
Reproductions/Basic.leanand observe that Lean complains fails to importReproductions.Dependency.lean.
module
public import Reproductions.DependencyReproductions/Dependency.lean:
module
declare_syntax_cat ebnfExpected behavior:
No errors, module is imported successfully.
Actual behavior:
Error: `Unknown constant `_private.Reproductions.Dependency.0.ebnf.quot`
There is a workaround: The error disappears if declare_syntax_cat is wrapped in a public section.
Versions
Lean 4.28.0-nightly-2025-12-28
Target: arm64-apple-darwin24.6.0 macOS
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