提交 83f758cf 编写于 作者: B Brian Anderson 提交者: Graydon Hoare

Typecheck expr_send and expr_recv

上级 a309f74a
......@@ -1830,6 +1830,22 @@ fn check_assignment_like(&@fn_ctxt fcx, @ast.expr lhs, @ast.expr rhs)
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册