Unify the rhs and lhs types in a send
Closes #662. One-line fixes are always the best :-D
This commit is contained in:
parent
79ce5a4614
commit
9427864f33
2 changed files with 11 additions and 0 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
10
src/test/run-pass/send-type-inference.rs
Normal file
10
src/test/run-pass/send-type-inference.rs
Normal 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() {
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue