lean4-htt/tests/lean/4452.lean
Kim Morrison f70b7e5722
feat: @[deprecated] requires a replacement identifier or message, and a since field (#6112)
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.
2024-11-26 08:45:54 +00:00

29 lines
513 B
Text

def a := 1
@[deprecated "Don't use `hi`." (since := "1970-01-01")]
theorem hi : a = 1 := rfl
attribute [simp] hi
example (h : 1 = b) : a = b := by
simp
guard_target =ₛ 1 = b
exact h
set_option linter.all true
example (h : 1 = b) : a = b := by
simp[
hi
]
guard_target =ₛ 1 = b
exact h
@[deprecated "Don't use `hi'`, either." (since := "1970-01-01")]
theorem hi' : True := .intro
example : True := by
-- the warning is on `simp`
simp [
hi' -- warning should be logged here
]