Rewrite exhaustiveness checker

Issue #352
Closes #1720

The old checker would happily accept things like 'alt x { @some(a) { a } }'.
It now properly descends into patterns, checks exhaustiveness of booleans,
and complains when number/string patterns aren't exhaustive.
This commit is contained in:
Marijn Haverbeke 2012-02-15 09:40:42 +01:00
parent 4b63826050
commit 67cc89f38d
32 changed files with 193 additions and 125 deletions

View file

@ -30,7 +30,7 @@ fn log_cont() { do { log(error, cont); } while false }
fn ret_ret() -> int { ret (ret 2) + 3; }
fn ret_guard() {
alt 2 {
alt check 2 {
x if (ret) { x; }
}
}