diff options
| author | Patrick Walton <[email protected]> | 2010-12-13 16:44:20 -0800 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-12-13 16:44:20 -0800 |
| commit | 90807e240fb67529f65fc85a7964c4cc98176678 (patch) | |
| tree | 1a66ef324cd0eeb2911f005e1f73cdf86c1fdf8f /src | |
| parent | rustc: Check patterns before arm blocks in alt expressions; this will be need... (diff) | |
| download | rust-90807e240fb67529f65fc85a7964c4cc98176678.tar.xz rust-90807e240fb67529f65fc85a7964c4cc98176678.zip | |
rustc: Typecheck pattern bindings
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp/middle/typeck.rs | 1 |
1 files changed, 1 insertions, 0 deletions
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)) { |