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

Adds diagnostic if no return statement found in function #1299

Merged
merged 3 commits into from
Oct 9, 2024

Conversation

markwpearce
Copy link
Collaborator

image

If a function explicitly says it will return something, ensure there is a return statement.

This could be improved by checking all branches.

I know there's a BSLint option that basically checks the same thing, but if you don't have a return statement when you say you're going to return a string or an integer, it will crash.

@markwpearce markwpearce added this to the v1.0.0 milestone Sep 10, 2024
Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

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

Hey, I added some comments about a few more edge cases we need to test for.

@TwitchBronBron TwitchBronBron deleted the branch release-1.0.0 September 25, 2024 15:06
@TwitchBronBron TwitchBronBron reopened this Oct 1, 2024
Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

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

I agree, this belongs in bsc because it has runtime implications when these are mismatched.

@TwitchBronBron TwitchBronBron merged commit d585c29 into release-1.0.0 Oct 9, 2024
6 checks passed
@TwitchBronBron TwitchBronBron deleted the missing_return_statement branch October 9, 2024 12:02
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