Skip to content

Investigate terminate state after infinite loop with return #1138

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

Closed
dcodeIO opened this issue Mar 1, 2020 · 0 comments
Closed

Investigate terminate state after infinite loop with return #1138

dcodeIO opened this issue Mar 1, 2020 · 0 comments
Labels

Comments

@dcodeIO
Copy link
Member

dcodeIO commented Mar 1, 2020

While working on #1129 I noticed that code like the following still wants a return statement

  get file(): File {
    var current: Element = this;
    do {
      current = current.parent;
      if (current.kind == ElementKind.FILE) return <File>current;
    } while (true);
    return <File>unreachable(); // here
  }

not noticing that control flow cannot actually fall through. Pinning here so we don't forget.

@dcodeIO dcodeIO added the bug label Mar 1, 2020
@dcodeIO dcodeIO mentioned this issue Mar 1, 2020
8 tasks
dcodeIO added a commit that referenced this issue Mar 2, 2020
@dcodeIO dcodeIO closed this as completed Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant