-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
Description
#![feature(globs)]
use Char::*;
enum Char {
A(int),
B(i32),
C(char),
}
fn main(){
let a = Char::A(7);
// This match doesn't work because `x` changes type inside
// one arm. The compiler should take this and generate an
// equivalent of the second `match` example.
match a {
A(x) | B(x) | C(x) => println!("{}", x),
}
// This works because `x` doesn't change type inside an arm.
match a {
A(x) => println!("{}", x),
B(x) => println!("{}", x),
C(x) => println!("{}", x),
}
}
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.