Skip to content

Commit 8e7a1ba

Browse files
authored
doc: document the full syntax for the deprecation attribute
The other day, I wanted to apply the full form (with a custom message and a deprecation date) in mathlib and failed to guess the correct order. The doc-string seemed to suggest that combining them was impossible (which was luckily false). Let's clarify that - a custom message and deprecation date can be combined - what the expected order is
1 parent b8c941d commit 8e7a1ba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Init/Notation.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@ existing code. It may be removed in a future version of the library.
564564
* `@[deprecated myBetterDef]` means that `myBetterDef` is the suggested replacement.
565565
* `@[deprecated myBetterDef "use myBetterDef instead"]` allows customizing the deprecation message.
566566
* `@[deprecated (since := "2024-04-21")]` records when the deprecation was first applied.
567+
* the last two options can be combined: @[deprecated myBetterDef "use myBetterDef instead" (since := "2024-04-21")]`
568+
customizes the deprecation message and specifies the deprecation date
567569
-/
568570
syntax (name := deprecated) "deprecated" (ppSpace ident)? (ppSpace str)?
569571
(" (" &"since" " := " str ")")? : attr

0 commit comments

Comments
 (0)