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

Check for missing return statement #592

Merged
merged 3 commits into from
Dec 21, 2017

Conversation

jacqueswww
Copy link
Contributor

- What I did

Partial fix for #590.
Check for a minimum of 1 return statement if specified.

- How I did it

Added a count in the function context.

- How to verify it

@public
def foo() -> num:
        pass

- Description for the changelog

- Cute Animal Picture

@jacqueswww jacqueswww changed the title 590 missing return statement Check for missing return statement Dec 19, 2017
@fubuloubu
Copy link
Member

LGTM for now, obviously will have to rewrite it when we do the branching check instead.

Actually, can you add a TODO note to that effect in the parser code?

@DavidKnott
Copy link
Contributor

DavidKnott commented Dec 19, 2017

Looks like a good first step, particularly because making sure every endpoint has the correct return is significantly more logic. I'd love to see a test or two with conditional returns to make the limits of this fix clearer.

@DavidKnott
Copy link
Contributor

LGTM, merging it in.

@DavidKnott DavidKnott merged commit bee759a into vyperlang:master Dec 21, 2017
@fubuloubu
Copy link
Member

Since we have the correct algorithm in #590 according to @yzhang90, perhaps we can upgrade the check now?

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