Closed
Description
If only the enumeration type itself is imported but not its variants, a match expression reports unreachable pattern instead of unrecognised type:
pub mod inner {
pub enum E {
E1,
E2
}
}
pub mod foo {
use inner::E; // change this to use inner::{E, E1, E2} then all will be fine
pub fn bar(e: E) -> int {
match e {
E1 => 0,
E2 => 1 // error: unreachable pattern
}
}
}
pub fn main() {}
Is this something intentional? Or should we give it a more sensible error message?
Metadata
Metadata
Assignees
Labels
No labels