aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-04-14 12:33:26 -0700
committerPatrick Walton <[email protected]>2011-04-14 12:33:26 -0700
commit35e021ed53d3ab9e63686ec7d79bc3ca2af0c820 (patch)
tree81422e3913c5c583dbcc7285048da2c8f783d93e /src
parentrt: Remove half-baked, incomplete, commented-out print_stack_trace() stub (diff)
downloadrust-35e021ed53d3ab9e63686ec7d79bc3ca2af0c820.tar.xz
rust-35e021ed53d3ab9e63686ec7d79bc3ca2af0c820.zip
rustc: Perform type substitutions when recording locals
Diffstat (limited to 'src')
-rw-r--r--src/comp/middle/typeck.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs
index 4fb685ec..211fb349 100644
--- a/src/comp/middle/typeck.rs
+++ b/src/comp/middle/typeck.rs
@@ -858,6 +858,15 @@ mod Unify {
}
}
}
+
+ // TODO: "freeze"
+ let vec[@ty.t] param_substs_1 = vec();
+ for (@ty.t subst in param_substs) {
+ param_substs_1 += vec(subst);
+ }
+
+ unified_type =
+ ty.substitute_type_params(param_substs_1, unified_type);
fcx.locals.insert(id, unified_type);
}
fn record_param(uint index, @ty.t binding) -> ty.unify_result {
@@ -1617,7 +1626,8 @@ fn check_pat(&@fn_ctxt fcx, @ast.pat pat) -> @ast.pat {
}
fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
- // log "typechecking expr " + pretty.pprust.expr_to_str(expr);
+ //fcx.ccx.sess.span_warn(expr.span, "typechecking expr " +
+ // pretty.pprust.expr_to_str(expr));
// A generic function to factor out common logic from call and bind
// expressions.