This PR fixes an issue where `exact?` would not suggest private declarations defined in the current module. ## Problem When using `exact?` in a file with private declarations, those private declarations were not being suggested even though they are valid and accessible: ```lean module axiom P : Prop private axiom p : P example : P := by exact? -- error: could not find lemma ``` The problem was that `blacklistInsertion` in `LazyDiscrTree` was filtering out all declarations whose names matched `isInternalDetail`, which includes private names due to their `_private.Module.0.name` structure. ## Solution The fix adds a helper function `isPrivateNameOf` that checks if a private declaration belongs to a specific module. The `blacklistInsertion` function now allows private declarations belonging to the current module (`env.header.mainModule`) to pass through the filter. Private declarations from imported modules are still filtered out, as they may reference internal declarations that aren't accessible (which would cause processing errors). Zulip discussion: https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/.60exact.3F.60.20and.20private.20declarations/near/564586152 🤖 Prepared with Claude Code --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| bench | ||
| bench-radar | ||
| compiler | ||
| elabissues | ||
| ir | ||
| lake | ||
| lean | ||
| pkg | ||
| playground | ||
| plugin | ||
| simpperf | ||
| .gitignore | ||
| common.sh | ||
| lakefile.toml | ||
| lean-toolchain | ||