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

Don't require a returns comment for functions that never return. #225

Merged
merged 1 commit into from
Aug 25, 2020

Conversation

dylansturg
Copy link
Contributor

Any function whose return type is Never is ignored when validating returns comments: there won't be a warning to add a comment nor a warning to remove an existing comment. It might be useful to document the fact that the function doesn't return, or that might be trivial and not worth documenting.

It's possible for someone to use a typealias for Never, instead of directly using Never, but that would be very strange and isn't supported.

It's possible for someone to use a typealias for `Never`, instead of directly using `Never`, but that would be very strange and isn't supported. Any function whose return type is `Never` is ignored when validating returns comments: there won't be a warning to add a comment nor a warning to remove an existing comment. It might be useful to document the fact that the function doesn't return, or that might be trivial and not worth documenting.
@allevato allevato merged commit 5461498 into swiftlang:master Aug 25, 2020
allevato added a commit to allevato/swift-format that referenced this pull request Sep 17, 2020
Don't require a returns comment for functions that never return.
allevato added a commit that referenced this pull request Sep 17, 2020
Don't require a returns comment for functions that never return.
@dylansturg dylansturg deleted the never_doesnt_return branch May 4, 2022 23:17
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.

2 participants