SerenityOS / jakt

The Jakt Programming Language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect "reaches end of non-void function" error when `catch` clause calls a never-returning function

awesomekling opened this issue · comments

This currently fails to compile, despite being valid. abort() has return type never in the prelude, so the compiler should see that all branches return here.

fn foo() -> [i64] {
    try {
        return []
    } catch {
        abort()
    }
}