rustc: Typecheck pattern bindings

This commit is contained in:
Patrick Walton 2010-12-13 16:44:20 -08:00
parent 0ef65780ca
commit 90807e240f

View file

@ -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)) {