Skip to content

Commit cac0acb

Browse files
committed
---
yaml --- r: 2707 b: refs/heads/master c: e24d7ae h: refs/heads/master i: 2705: ea2e672 2703: e4392bb v: v3
1 parent 308c048 commit cac0acb

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: c0b4fc18460af0ef656b74a57c1b2deacae17408
2+
refs/heads/master: e24d7ae96724565252676fc56d7c21a7e0e7eebb

trunk/src/comp/middle/typeck.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,10 +2144,8 @@ fn check_expr(&@stmt_ctxt scx, &@ast::expr expr) {
21442144
if (!ty::type_is_bot(scx.fcx.ccx.tcx, elsopt_t)) {
21452145
Pushdown::pushdown_expr(scx, thn_t, els);
21462146
if_t = elsopt_t;
2147-
} else if (!ty::type_is_bot(scx.fcx.ccx.tcx, thn_t)) {
2148-
if_t = thn_t;
21492147
} else {
2150-
if_t = ty::mk_nil(scx.fcx.ccx.tcx);
2148+
if_t = thn_t;
21512149
}
21522150
}
21532151
case (none[@ast::expr]) {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// xfail-stage0
2+
3+
// When all branches of an if expression result in fail, the entire if
4+
// expression results in fail.
5+
6+
fn main() {
7+
auto x = if (true) {
8+
10
9+
} else {
10+
if (true) {
11+
fail
12+
} else {
13+
fail
14+
}
15+
};
16+
}

0 commit comments

Comments
 (0)