You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect the below program to fail to typecheck. It succeeds, however, and prints bogus output.
pub enum T {
T1(()),
T2(())
}
pub enum V {
V1(int),
V2(bool)
}
fn foo (x : (T, V)) {
match x {
(T1(()), V1(i)) => println!("T1(()), V1({})", i),
(T2(()), V2(b)) => println!("T2(()), V2({})", b),
// _ => ()
// We need to handle the T1,V2 and T2,V1 cases, but if we add
// the wildcard here, we get an "unreachable pattern" error.
}
}
fn main () {
foo((T1(()), V2(true)));
// prints "T1(()), V1(0)"
foo((T2(()), V1(99)));
// prints "T2(()), V2(false)"
}
This is perhaps related to recent changes by @jakub- ?
The text was updated successfully, but these errors were encountered:
I observe the following behavior at 575710f
I expect the below program to fail to typecheck. It succeeds, however, and prints bogus output.
This is perhaps related to recent changes by @jakub- ?
The text was updated successfully, but these errors were encountered: