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
30 lines
717 B
Text
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)
|