Skip to content

Commit

Permalink
chore: Only allow one since on types and functions
Browse files Browse the repository at this point in the history
  • Loading branch information
spotandjake committed Jan 3, 2024
1 parent 08d2ff4 commit 9b7312b
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions compiler/graindoc/docblock.re
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,15 @@ let for_type_declaration =
examples,
)
| Since({attr_version}) =>
// TODO(#787): Should we fail if more than one `@since` attribute?
(
deprecations,
Some({since_version: attr_version}),
history,
examples,
)
switch (since) {
| Some(_) => raise(AttributeAppearsMultipleTimes({attr: "since"}))
| None => (
deprecations,
Some({since_version: attr_version}),
history,
examples,
)
}
| History({attr_version: history_version, attr_desc: history_msg}) => (
deprecations,
since,
Expand Down Expand Up @@ -528,13 +530,15 @@ and for_signature_items =
examples,
)
| Since({attr_version}) =>
// TODO(#787): Should we fail if more than one `@since` attribute?
(
deprecations,
Some({since_version: attr_version}),
history,
examples,
)
switch (since) {
| Some(_) => raise(AttributeAppearsMultipleTimes({attr: "since"}))
| None => (
deprecations,
Some({since_version: attr_version}),
history,
examples,
)
}
| History({attr_version: history_version, attr_desc: history_msg}) => (
deprecations,
since,
Expand Down

0 comments on commit 9b7312b

Please sign in to comment.