rust/src/test/run-pass/compare-generic-enums.rs
Niko Matsakis e4694ca519 add a test that types w/ def_ids compare just fine to types w/o def_ids
this is not clearly going to work due to monomorphization, which convverts
each enum<T> to a distinct "type" from POV of the shape code
2012-05-30 11:04:12 -07:00

12 lines
228 B
Rust

type an_int = int;
fn cmp(x: option<an_int>, y: option<int>) -> bool {
x == y
}
fn main() {
assert !cmp(some(3), none);
assert !cmp(some(3), some(4));
assert cmp(some(3), some(3));
assert cmp(none, none);
}