Skip to content

Commit 7d50055

Browse files
committed
---
yaml --- r: 1327 b: refs/heads/master c: b3689e7 h: refs/heads/master i: 1325: 1aa3f53 1323: 4330b0c 1319: e6bbab3 1311: cd11ec9 v: v3
1 parent f19ba5c commit 7d50055

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
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: 70bf54bcac587c0bc8a3a593bda75115e4c23aa8
2+
refs/heads/master: b3689e7c209d6caf6a0a551b9fbfe87942be723d

trunk/src/comp/middle/typeck.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,21 @@ fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
13331333
ast.expr_alt(expr_1, arms_1, ann));
13341334
}
13351335

1336+
case (ast.expr_block(?b, _)) {
1337+
auto b_0 = check_block(fcx, b);
1338+
auto ann;
1339+
alt (b_0.node.expr) {
1340+
case (some[@ast.expr](?expr)) {
1341+
ann = ast.ann_type(expr_ty(expr));
1342+
}
1343+
case (none[@ast.expr]) {
1344+
ann = ast.ann_type(plain_ty(ty.ty_nil));
1345+
}
1346+
}
1347+
ret @fold.respan[ast.expr_](expr.span,
1348+
ast.expr_block(b_0, ann));
1349+
}
1350+
13361351
case (ast.expr_bind(?f, ?args, _)) {
13371352
auto f_0 = check_expr(fcx, f);
13381353
auto t_0 = expr_ty(f_0);

0 commit comments

Comments
 (0)