diff options
| author | Brian Anderson <[email protected]> | 2011-03-13 03:26:11 -0400 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-03-14 16:41:46 -0700 |
| commit | 83f758cf0dfaefc2ebb3a26404e8a9e009847af7 (patch) | |
| tree | 913706fba43d70835e4b8d4b8325926aa6c5725a | |
| parent | Reorganize evaluation of expr_send/recv to put them closer to expr_assign, to... (diff) | |
| download | rust-83f758cf0dfaefc2ebb3a26404e8a9e009847af7.tar.xz rust-83f758cf0dfaefc2ebb3a26404e8a9e009847af7.zip | |
Typecheck expr_send and expr_recv
| -rw-r--r-- | src/comp/middle/typeck.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index f44292d5..a654a2fc 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -1830,6 +1830,22 @@ fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr { ret @fold.respan[ast.expr_](expr.span, newexpr); } + case (ast.expr_send(?lhs, ?rhs, _)) { + auto checked = check_assignment_like(fcx, lhs, rhs); + auto newexpr = ast.expr_send(checked._0, + checked._1, + checked._2); + ret @fold.respan[ast.expr_](expr.span, newexpr); + } + + case (ast.expr_recv(?lhs, ?rhs, _)) { + auto checked = check_assignment_like(fcx, lhs, rhs); + auto newexpr = ast.expr_recv(checked._0, + checked._1, + checked._2); + ret @fold.respan[ast.expr_](expr.span, newexpr); + } + case (ast.expr_if(?cond, ?thn, ?elifs, ?elsopt, _)) { auto cond_0 = check_expr(fcx, cond); auto cond_1 = demand_expr(fcx, plain_ty(ty.ty_bool), cond_0); |