Skip to content

Commit 8d8ff16

Browse files
committed
Improve handling of bottom type in alt arms
1 parent 5cf5f50 commit 8d8ff16

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/comp/middle/typeck.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,6 +2000,7 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
20002000
}
20012001
}
20022002
bot |= !arm_non_bot;
2003+
if !arm_non_bot { result_ty = ty::mk_bot(fcx.ccx.tcx); }
20032004
write::ty_only_fixup(fcx, id, result_ty);
20042005
}
20052006
ast::expr_fn(f) {

0 commit comments

Comments
 (0)