Skip to content

Commit 5bb6b1c

Browse files
committed
---
yaml --- r: 1696 b: refs/heads/master c: e8938f5 h: refs/heads/master v: v3
1 parent 772b44d commit 5bb6b1c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-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: 6dee1ac161a22a4bc1e49c5dac3c7bbba1ff97f0
2+
refs/heads/master: e8938f5fb2cfa756b8186f6ed33e2d0d509a31a0

trunk/src/comp/middle/typeck.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,20 @@ fn demand_expr_full(&@fn_ctxt fcx, @ty.t expected, @ast.expr e,
14011401
e_1 = ast.expr_chan(es_1, ast.ann_type(t, none[vec[@ty.t]]));
14021402
}
14031403

1404+
case (ast.expr_alt(?discrim, ?arms_0, ?ann)) {
1405+
auto t = expected;
1406+
let vec[ast.arm] arms_1 = vec();
1407+
for (ast.arm arm_0 in arms_0) {
1408+
auto block_1 = demand_block(fcx, expected, arm_0.block);
1409+
t = demand(fcx, e.span, t, block_ty(block_1));
1410+
auto arm_1 = rec(pat=arm_0.pat, block=block_1,
1411+
index=arm_0.index);
1412+
arms_1 += vec(arm_1);
1413+
}
1414+
e_1 = ast.expr_alt(discrim, arms_1,
1415+
ast.ann_type(t, none[vec[@ty.t]]));
1416+
}
1417+
14041418
case (_) {
14051419
fcx.ccx.sess.span_unimpl(e.span,
14061420
"type unification for expression variant");

0 commit comments

Comments
 (0)