lean4-htt/tests/lean/run/5236.lean
Kyle Miller 8e88e8061a
chore: deprecate := variants of inductive and structure (#5542)
Deprecates `inductive ... :=`, `structure ... :=`, and `class ... :=` in
favor of the `... where` variant. Currently this syntax produces a
warning, controlled by the `linter.deprecated` option.

Breaking change: modifies `Lean.Linter.logLintIf` to use
`Lean.Linter.getLinterValue` to determine if a linter value is set. This
means that the `linter.all` option now is taken into account when the
linter option is not set.

Part of #5236
2024-10-11 05:54:18 +00:00

30 lines
717 B
Text

/-!
# Deprecate `:=` for `inductive` and `structure`
-/
set_option linter.deprecated true
/--
warning: 'inductive ... :=' has been deprecated in favor of 'inductive ... where'.
note: this linter can be disabled with `set_option linter.deprecated false`
-/
#guard_msgs in
inductive DogSound' :=
| woof
| grr
/--
warning: structure ... :=' has been deprecated in favor of 'structure ... where'.
note: this linter can be disabled with `set_option linter.deprecated false`
-/
#guard_msgs in
structure S :=
(n : Nat)
/--
warning: class ... :=' has been deprecated in favor of 'class ... where'.
note: this linter can be disabled with `set_option linter.deprecated false`
-/
#guard_msgs in
class C :=
(n : Nat)