Unify the rhs and lhs types in a send

Closes #662.

One-line fixes are always the best :-D
This commit is contained in:
Tim Chevalier 2011-07-11 15:02:50 -07:00
parent 79ce5a4614
commit 9427864f33
2 changed files with 11 additions and 0 deletions

View file

@ -1877,6 +1877,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
fcx.ccx.tcx.sess.span_fatal(expr.span,s);
}
}
demand::simple(fcx, expr.span, chan_t, lhs_t);
write::ty_only_fixup(fcx, id, chan_t);
}
case (ast::expr_recv(?lhs, ?rhs)) {

View file

@ -0,0 +1,10 @@
// xfail-stage0
// tests that ctrl's type gets inferred properly
type command[K, V] = rec(K key, V val);
fn cache_server[K, V] (chan[chan[command[K,V]]] c) {
auto ctrl = port();
c <| chan(ctrl);
}
fn main() {
}