f39477d926
resolve3 wasn't checking this. Added test cases. Also added a helpful informational message in the case where you have a variable binding that you probably think refers to a variant that you forgot to import. This is easier to do in resolve than in typeck because there's code in typeck that assumes that each of the patterns binds the same number of variables.
16 lines
231 B
Rust
16 lines
231 B
Rust
mod bar {
|
|
enum foo {
|
|
alpha,
|
|
beta,
|
|
charlie
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
import bar::{alpha, charlie};
|
|
alt alpha {
|
|
alpha | beta {} //~ ERROR: inconsistent number of bindings
|
|
charlie {}
|
|
}
|
|
}
|