diff --git a/src/test/run-pass/alt-with-ret-arm.rs b/src/test/run-pass/alt-with-ret-arm.rs new file mode 100644 index 000000000000..20fe17d4847b --- /dev/null +++ b/src/test/run-pass/alt-with-ret-arm.rs @@ -0,0 +1,11 @@ +fn main() { + // sometimes we have had trouble finding + // the right type for f, as we unified + // bot and u32 here + let f = alt uint::from_str("1234") { + none { ret () } + some(num) { num as u32 } + }; + assert f == 1234u32; + log(error, f) +}