Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out more doc signature expressions #774

Merged
merged 2 commits into from
Nov 10, 2023
Merged

Filter out more doc signature expressions #774

merged 2 commits into from
Nov 10, 2023

Conversation

fredrikekre
Copy link
Collaborator

Revise extracts the documented expression and puts that before the full
doc expression in the revision queue. E.g. in "docs" f(x) = x there
will be a revision of f(x) = x followed by a revision of the full
expresion ("docs" f(x) = x). However, in many cases a docstring is
only attached to a signature (not a function body/struct definition,
etc.) and in this case the revision of the signature is not needed.

Revise already filters out the base case, "docs" f(x). This patch
extends this filtering to also apply to where-clauses such as e.g.
"docs" f(x::T) where T <: Integer.

Concretely, this patch fixes #735, i.e. revising doc expressions where
the signature doesn't lower without the context of the doc macro. As a
bonus, slightly less work has to be done for e.g. "docs" f(x::T) where T since this is also filtered out.

Revise extracts the documented expression and puts that before the full
doc expression in the revision queue. E.g. in `"docs" f(x) = x` there
will be a revision of `f(x) = x` followed by a revision of the full
expresion (`"docs" f(x) = x`). However, in many cases a docstring is
only attached to a signature (not a function body/struct definition,
etc.) and in this case the revision of the signature is not needed.

Revise already filters out the base case, `"docs" f(x)`. This patch
extends this filtering to also apply to `where`-clauses such as e.g.
`"docs" f(x::T) where T <: Integer`.

Concretely, this patch fixes #735, i.e. revising doc expressions where
the signature doesn't lower without the context of the doc macro. As a
bonus, slightly less work has to be done for e.g. `"docs" f(x::T) where
T` since this is also filtered out.
@fredrikekre
Copy link
Collaborator Author

CI failures are unrelated -- looks like tests need a bit of work to pass on nightly (probably the result of stdlib excision).

@KristofferC KristofferC merged commit 1059181 into master Nov 10, 2023
9 of 13 checks passed
@fredrikekre fredrikekre deleted the fe/nohack branch November 10, 2023 08:27
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.

Revising "docstring" f(::A{T}) where T fails with semi-helpful error message
2 participants