Closed
Description
This code:
mod foo {
pub enum Bars {
BarFoo,
BarBar,
BarBaz
}
}
fn main() {
decide(foo::BarBar);
}
fn decide(bar: foo::Bars) -> int {
match bar {
BarFoo => 0,
BarBar => 42,
BarBaz => 128
}
}
should fail to compile because it can't resolve the enum variants in the match statement.
But currently it outputs this error message instead:
match_namespace.rs:16:8: 16:17 error: unreachable pattern
match_namespace.rs:16 BarBar => 42,
^~~~~~~~~
match_namespace.rs:17:8: 17:17 error: unreachable pattern
match_namespace.rs:17 BarBaz => 128
^~~~~~~~~
Which is curious because it doesn't complaint about the first item in the match statement, and because it somehow confuses 'Don't know what it is' with 'Can't reach it'.