snirk-lang / protosnirk

The beginnings of a programming language
MIT License
1 stars 1 forks source link

Early returns are not handled properly #91

Open SnirkImmington opened 5 years ago

SnirkImmington commented 5 years ago

The program

fn main()
    return

doesn't work; we attempt to emit an extra ret void at the end of methods that don't have an explicit return type.

We could do a check of whether we are returning early at the identify or LLVM phase.