Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/MathlibTest/Linter/PrivateModule/     Datei vom 15.10.2026 mit Größe 1 kB image not shown  

Quelle  ReservedName2.lean   Sprache: Lean

 

module

import Mathlib.Init
import all Mathlib.Tactic.Linter.PrivateModule
public import MathlibTest.Linter.PrivateModule.ReservedName1

open Lean

-- `foo.eq_1` is still reserved:
/-- info: true -/
#guard_msgs in
run_cmd do
  logInfo m!"{isReservedName (← getEnv) ``foo.eq_1}"

-- `foo.eq_1` is not yet realized:
/-- info: reserved names: [] -/
#guard_msgs in
#show_new_reserved

-- realize `foo.eq_1`:
/--
info: @[backward_defeq] theorem foo.eq_1 : foo = true :=
Eq.refl foo
-/

#guard_msgs in
#print foo.eq_1

-- Make sure `foo.eq_1` is in the local constants, and does not start with `_private`
/-- info: reserved names: [foo.eq_1] -/
#guard_msgs in
#show_new_reserved

-- The linter should fire despite the public name `foo.eq_1` being present
set_option linter.mathlibStandardSet true in
open Mathlib.Linter Parser in
/--
warning: The current module only contains private declarations.

Consider adding `public section` at the beginning of the module, or selectively marking declarations as `public`. Mark a `def` with `@[expose]` if downstream code needs it to be definitionally equal to its body (e.g. for `unfold`). Alternatively, add `@[expose] public section` to mark every definition as exposed.

Note: This linter can be disabled with `set_option linter.privateModule false`
-/

#guard_msgs in
run_cmd do privateModule.run #[]

Messung
CHZG
9310010097

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland