From 90807e240fb67529f65fc85a7964c4cc98176678 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 13 Dec 2010 16:44:20 -0800 Subject: rustc: Typecheck pattern bindings --- src/comp/middle/typeck.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index 85ee74da..40e39888 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -1186,6 +1186,7 @@ fn demand_pat(&fn_ctxt fcx, @ty expected, @ast.pat pat) -> @ast.pat { } case (ast.pat_bind(?id, ?did, ?ann)) { auto t = demand(fcx, pat.span, expected, ann_to_type(ann)); + fcx.locals.insert(did, t); p_1 = ast.pat_bind(id, did, ast.ann_type(t)); } case (ast.pat_tag(?id, ?subpats, ?vdef_opt, ?ann)) { -- cgit v1.2.3