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

No unreachable warning for some infinite loops #15

Closed
Akuli opened this issue Dec 31, 2022 · 1 comment · Fixed by #22
Closed

No unreachable warning for some infinite loops #15

Akuli opened this issue Dec 31, 2022 · 1 comment · Fixed by #22

Comments

@Akuli
Copy link
Owner

Akuli commented Dec 31, 2022

I'm preparing a pull request to show warnings for unreachable code, but it doesn't work in at least these two cases I tried:

def after_infinite_loop_with_variable() -> void:
    flag = True
    while flag:
        puts("hi")
    puts("yooooo wat")  # Warning: this code will never run

def after_infinite_loop_with_variable_set_after_loop() -> void:
    flag = True
    while flag:
        puts("hi")
    flag = False  # Warning: this code will never run
@Akuli
Copy link
Owner Author

Akuli commented Jan 1, 2023

Now the first example works as expected. The second one is still broken.

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 a pull request may close this issue.

1 participant