lean4-htt/tests/pkg/module/Module/PrivateImported.lean
Sebastian Ullrich 8e6f2750da
fix: namespace used in private import and current module vanishes dowstream (#12840)
This PR fixes an issue where the use of private imports led to unknown
namespaces in downstream modules.

Fixes #12833
2026-03-20 13:27:26 +00:00

34 lines
806 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 public declaration `f` exists but is imported privately; consider adding `public import Module.Basic`.
-/
#guard_msgs in
public theorem t2 : f = 1 := sorry
/--
error: Unknown identifier `f`
Note: A public declaration `f` exists but is imported privately; consider adding `public import Module.Basic`.
-/
#guard_msgs in
@[expose] public def h : True := f
/-! `initialize` should be run even if imported IR-only. -/
public def publicDefOfPrivatelyInitialized := initialized
/-! #12198: `local simp` should be accepted on privately imported theorem -/
attribute [local simp] t
/-- Setup for #12833. -/
public def Namespaced.def2 := 0