This PR makes stricter requirements for the `@[deprecated]` attribute, requiring either a replacement identifier as `@[deprecated bar]` or suggestion text `@[deprecated "Past its use by date"]`, and also requires a `since := "..."` field.
15 lines
276 B
Text
15 lines
276 B
Text
set_option linter.deprecated true
|
|
|
|
def f (x : Nat) := x + 1
|
|
|
|
@[deprecated f (since := "1970-01-01")]
|
|
def g (x : Nat) := x + 1
|
|
|
|
#eval g 0 -- warning
|
|
|
|
set_option warningAsError true
|
|
|
|
#eval g 0 -- error
|
|
|
|
set_option linter.unusedVariables true
|
|
def h (unused : Nat) := 0 -- error
|