Skip to content

Commit 1fb3790

Browse files
committed
doc: also mention the full syntax for the deprecated attribute
The other day, I wanted to apply the full form (i.e., with both a custom message and a deprecation date) in mathlib and failed to guess the correct order of these two. The attribute doc-string seemed to suggest that combining them was impossible (which was luckily false). To prevent this from re-occurring, clarify the doc-string by - mentioning that a custom message and deprecation date can be combined - what the expected order of these two is
1 parent b8c941d commit 1fb3790

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Init/Notation.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,9 @@ 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:
568+
`@[deprecated myBetterDef "use myBetterDef instead" (since := "2024-04-21")]`
569+
customizes the deprecation message and specifies the deprecation date
567570
-/
568571
syntax (name := deprecated) "deprecated" (ppSpace ident)? (ppSpace str)?
569572
(" (" &"since" " := " str ")")? : attr

0 commit comments

Comments
 (0)