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

Changed ExpectReturnOnAllPaths() to treat continuation, run and await as missing returns #1258

Merged
merged 3 commits into from
May 17, 2022
Merged

Conversation

pk19604014
Copy link
Contributor

Fixes #1257

@pk19604014 pk19604014 marked this pull request as ready for review May 16, 2022 13:47
@pk19604014 pk19604014 requested a review from a team as a code owner May 16, 2022 13:47
Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

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

I'm not sure this is correct: can you please add a test case of

fn Main() -> i32 {
  var x: i32 = 0;
  __continuation k {
    x = x + 1;
    return x;
  }
}

And make sure this fails due to the missing return?

@pk19604014
Copy link
Contributor Author

I'm not sure this is correct: can you please add a test case of

fn Main() -> i32 {
  var x: i32 = 0;
  __continuation k {
    x = x + 1;
    return x;
  }
}

And make sure this fails due to the missing return?

Added fail_return_in_continuation.carbon. It fails both with and without the change with a 'return is not within a function body' error.

@pk19604014 pk19604014 requested a review from jonmeow May 17, 2022 14:50
@jonmeow jonmeow merged commit 33e2e4d into carbon-language:trunk May 17, 2022
@jonmeow jonmeow deleted the fuzz_231862757 branch May 17, 2022 16:07
chandlerc pushed a commit that referenced this pull request Jun 28, 2022
@chandlerc chandlerc added the explorer Action items related to Carbon explorer code label Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
explorer Action items related to Carbon explorer code
Projects
None yet
3 participants