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.
16 lines
337 B
Rust
16 lines
337 B
Rust
enum t { a, b, }
|
|
|
|
fn main() {
|
|
let x = a;
|
|
alt x { b { } } //! ERROR non-exhaustive patterns
|
|
alt true { //! ERROR non-exhaustive bool patterns
|
|
true {}
|
|
}
|
|
alt @some(10) { //! ERROR non-exhaustive patterns
|
|
@none {}
|
|
}
|
|
alt (2, 3, 4) { //! ERROR non-exhaustive literal patterns
|
|
(_, _, 4) {}
|
|
}
|
|
}
|