Closed
Description
This type checks (tag-disr-val-shape.rs
):
enum color {
red = 0;
green = 1;
blue = 2;
black = 3;
white = 4;
}
fn main() {
assert uint::to_str(red as uint, 10u) == #fmt["%?", red];
assert uint::to_str(green as uint, 10u) == #fmt["%?", green];
assert uint::to_str(white as uint, 10u) == #fmt["%?", white];
}
but this does not (tag-auto-disr-val-shape.rs
):
enum color { red; green; blue; black; white; }
fn main() {
assert (uint::to_str(red as uint, 10) == #fmt["%?", red]);
assert (uint::to_str(green as uint, 10) == #fmt["%?", green]);
assert (uint::to_str(white as uint, 10) == #fmt["%?", white]);
}
However, the two programs are equivalent but for the fact that in one case the discriminants were automatically assigned.
When fixing this bug, please remove the xfail-test
directives from those two test files!
Metadata
Metadata
Assignees
Labels
No labels