67cc89f38d
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.
14 lines
198 B
Rust
14 lines
198 B
Rust
// -*- rust -*-
|
|
// error-pattern: non-exhaustive patterns
|
|
enum t { a(u), b }
|
|
enum u { c, d }
|
|
|
|
fn main() {
|
|
let x = a(c);
|
|
alt x {
|
|
a(d) { fail "hello"; }
|
|
b { fail "goodbye"; }
|
|
}
|
|
}
|
|
|