Properly check types of do-while condition expr

Closes #956
This commit is contained in:
Marijn Haverbeke 2011-09-23 11:19:15 +02:00
parent 0bbde048a4
commit 348cd86d87

View File

@ -1920,7 +1920,8 @@ fn check_binop_type_compat(fcx: @fn_ctxt, span: span, ty: ty::t,
write::ty_only_fixup(fcx, id, ty::mk_nil(tcx));
}
ast::expr_do_while(body, cond) {
bot = check_expr(fcx, cond) | check_block(fcx, body);
bot = check_expr_with(fcx, cond, ty::mk_bool(tcx)) |
check_block(fcx, body);
write::ty_only_fixup(fcx, id, block_ty(tcx, body));
}
ast::expr_alt(expr, arms) {