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

Unreachable code warning is not emitted if panic is called as a funcion #3802

Open
malbarbo opened this issue Nov 7, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@malbarbo
Copy link

malbarbo commented Nov 7, 2024

For this code

fn f(a) { a }

pub fn main() {
  f(panic())
}

the compiler emits the warning "Panic used as a function" but not "Unreachable code" for f.

@malbarbo malbarbo added the bug Something isn't working label Nov 7, 2024
@lpil
Copy link
Member

lpil commented Nov 8, 2024

Hello! Do you not think the existing warnings highlights that the code doesn't work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants