Skip to content

Commit 83f758c

Browse files
brsongraydon
authored andcommitted
Typecheck expr_send and expr_recv
1 parent a309f74 commit 83f758c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/comp/middle/typeck.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,22 @@ fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
18301830
ret @fold.respan[ast.expr_](expr.span, newexpr);
18311831
}
18321832

1833+
case (ast.expr_send(?lhs, ?rhs, _)) {
1834+
auto checked = check_assignment_like(fcx, lhs, rhs);
1835+
auto newexpr = ast.expr_send(checked._0,
1836+
checked._1,
1837+
checked._2);
1838+
ret @fold.respan[ast.expr_](expr.span, newexpr);
1839+
}
1840+
1841+
case (ast.expr_recv(?lhs, ?rhs, _)) {
1842+
auto checked = check_assignment_like(fcx, lhs, rhs);
1843+
auto newexpr = ast.expr_recv(checked._0,
1844+
checked._1,
1845+
checked._2);
1846+
ret @fold.respan[ast.expr_](expr.span, newexpr);
1847+
}
1848+
18331849
case (ast.expr_if(?cond, ?thn, ?elifs, ?elsopt, _)) {
18341850
auto cond_0 = check_expr(fcx, cond);
18351851
auto cond_1 = demand_expr(fcx, plain_ty(ty.ty_bool), cond_0);

0 commit comments

Comments
 (0)