Skip to content

document how to put alerts on all structure/signature items - #13924

Merged
Octachron merged 3 commits into
ocaml:trunkfrom
v-gb:alerts-doc
Apr 3, 2025
Merged

Octachron merged 3 commits into
ocaml:trunkfrom
v-gb:alerts-doc

Conversation

@v-gb

@v-gb v-gb commented Apr 2, 2025

Copy link
Copy Markdown
Contributor

Personally, I had no idea it was possible to put an alert on a let binding until I saw it mentioned on a github issue, because it's undocumented. Ideally, warning 53 (unused attribute) would teach users that write:

let x = 1 [@@deprecated]

to write:

let x [@deprecated] = 1

instead, but I'm only changing doc here. And arguably, the first form could be interpreted as the second form, when the pattern contains a single variable (and fail otherwise), as that's how alerts works for all other binding constructs.

Comment thread manual/src/refman/extensions/alerts.etex Outdated
Comment thread manual/src/refman/extensions/alerts.etex
Comment thread manual/src/refman/extensions/alerts.etex Outdated
Comment thread manual/src/refman/extensions/alerts.etex
@v-gb
v-gb force-pushed the alerts-doc branch 2 times, most recently from 73f60a6 to 17186a4 Compare April 2, 2025 11:50
Comment thread manual/src/refman/extensions/alerts.etex Outdated
@v-gb
v-gb force-pushed the alerts-doc branch 2 times, most recently from f4db1ab to 21c7d49 Compare April 2, 2025 13:02

@Octachron Octachron left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a great idea, thanks!

Comment thread manual/src/refman/extensions/alerts.etex Outdated

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, feel free to ignore.

Comment thread manual/src/refman/extensions/alerts.etex Outdated
Comment thread manual/src/refman/extensions/alerts.etex Outdated
Comment thread manual/src/refman/extensions/alerts.etex
… items

Personally, I had no idea it was possible to put an alert on a let binding
until I saw it mentioned on a github issue, because it's undocumented.
Ideally, warning 53 would teach users that write:

    let x = 1 [@@deprecated]

to write:

    let x [@deprecated] = 1

instead, but I'm only changing doc here. And arguably, the first form
could be interpreted as the second form, when the pattern contains a
single variable (and fail otherwise), as that's how alerts works for
all other binding constructs.
@Octachron
Octachron merged commit 623b81e into ocaml:trunk Apr 3, 2025
@v-gb

v-gb commented Apr 3, 2025

Copy link
Copy Markdown
Contributor Author

Thanks!

@v-gb
v-gb deleted the alerts-doc branch April 3, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants