lean4-htt/tests/pkg/module/Module/PrivateImported.lean
Sebastian Ullrich 5244ac3bb5
feat: note inaccessible private declarations in unknown constant error (#9516)
This PR ensures that private declarations made inaccessible by the
module system are noted in the relevant error messages
2025-07-25 09:23:52 +00:00

24 lines
505 B
Text

module
import Module.Basic
/-! `private import` should allow only private access to imported decls. -/
public def g := f
/--
error: Unknown identifier `f`
Note: A private declaration `f` exists but is not accessible in the current context.
-/
#guard_msgs in
set_option autoImplicit false in
public theorem t2 : f = 1 := sorry
/--
error: Unknown identifier `f`
Note: A private declaration `f` exists but is not accessible in the current context.
-/
#guard_msgs in
@[expose] public def h : True := f