From 0eac640fdd56caa93d5f398a75d24e62feef4730 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 6 Jul 2011 13:36:27 -0700 Subject: Swap the expected/actual for typechecking fields of updated records In 'rec(a = b with c)', if a exists in c then the expected type for b is the type of c. --- src/comp/middle/typeck.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/comp') diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index 6d0ffb43202..5d06e9e7d04 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -2120,8 +2120,8 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) { auto found = false; for (ty::field bf in base_fields) { if (str::eq(f.ident, bf.ident)) { - demand::simple(fcx, expr.span, f.mt.ty, - bf.mt.ty); + demand::simple(fcx, expr.span, bf.mt.ty, + f.mt.ty); found = true; } } -- cgit 1.4.1-3-g733a5