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

Warn about the TailCall attribute on non-rec functions or let-bound values #16336

Merged
merged 3 commits into from
Nov 24, 2023

Conversation

dawedawe
Copy link
Contributor

Currently a user can do things like:

[<TailCall>]
let someNonRecFun x = x + x

[<TailCall>]
let someX = 23

[<TailCall>]
let rec someRecLetBoundValue = nameof(someRecLetBoundValue)

While not super harmful, this PR adds a warning for these constructs.

@dawedawe dawedawe requested a review from a team as a code owner November 23, 2023 15:03
Copy link
Member

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

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

Thanks!

@psfinaki
Copy link
Member

@dawedawe this is good to go - there is a conflict though (but shouldn't be a big deal).

@dawedawe
Copy link
Contributor Author

Thanks for the reviews. The conflict is resolved now.

@psfinaki psfinaki enabled auto-merge (squash) November 24, 2023 23:09
@psfinaki psfinaki merged commit b4dc66c into dotnet:main Nov 24, 2023
25 checks passed
@dawedawe dawedawe deleted the add_tailrecattronnonrec_warning branch November 24, 2023 23:50
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