This PR adjusts the experimental module system to make `private` the default visibility modifier in `module`s, introducing `public` as a new modifier instead. `public section` can be used to revert the default for an entire section, though this is more intended to ease gradual adoption of the new semantics such as in `Init` (and soon `Std`) where they should be replaced by a future decl-by-decl re-review of visibilities.
16 lines
333 B
Text
16 lines
333 B
Text
module
|
|
|
|
import Module.Basic
|
|
|
|
/-! `private import` should allow only private access to imported decls. -/
|
|
|
|
public def g := f
|
|
|
|
/-- error: unknown identifier 'f' -/
|
|
#guard_msgs in
|
|
set_option autoImplicit false in
|
|
public theorem t2 : f = 1 := sorry
|
|
|
|
/-- error: unknown identifier 'f' -/
|
|
#guard_msgs in
|
|
@[expose] public def h : True := f
|