Skip to content

Commit 9d0e644

Browse files
committed
---
yaml --- r: 2535 b: refs/heads/master c: 85120d9 h: refs/heads/master i: 2533: 348ec1a 2531: a88f5ab 2527: 5d62f23 v: v3
1 parent 4c342e3 commit 9d0e644

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 6997adf76342b7a6fe03c4bc370ce5fc5082a869
2+
refs/heads/master: 85120d9959a367b0cfc1abb75acb0bec7a244ede

trunk/src/comp/middle/ty.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,13 +1444,13 @@ fn eq_ty(&t a, &t b) -> bool { ret a == b; }
14441444

14451445
fn ann_to_ty_param_substs_opt_and_ty(&node_type_table ntt, &ast::ann ann)
14461446
-> ty_param_substs_opt_and_ty {
1447-
alt (ann) {
1448-
case (ast::ann_none(_)) {
1449-
log_err "ann_to_ty_param_substs_opt_and_ty() called on a node " +
1450-
"with no type params";
1447+
alt (ntt.(ast::ann_tag(ann))) {
1448+
case (none[ty::ty_param_substs_opt_and_ty]) {
1449+
log_err "ann_to_ty_param_substs_opt_and_ty() called on an " +
1450+
"untyped node";
14511451
fail;
14521452
}
1453-
case (ast::ann_type(_, ?t, ?tps, _)) { ret tup(tps, t); }
1453+
case (some[ty::ty_param_substs_opt_and_ty](?tpot)) { ret tpot; }
14541454
}
14551455
}
14561456

trunk/src/comp/middle/typeck.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ fn write_type(&node_type_table ntt, uint node_id,
377377
&ty_param_substs_opt_and_ty tpot) {
378378
_vec::grow_set[option::t[ty::ty_param_substs_opt_and_ty]]
379379
(*ntt,
380-
0u,
380+
node_id,
381381
none[ty_param_substs_opt_and_ty],
382382
some[ty_param_substs_opt_and_ty](tpot));
383383
}
@@ -1745,6 +1745,9 @@ fn replace_expr_type(&node_type_table ntt,
17451745
new_tps = none[vec[ty::t]];
17461746
}
17471747

1748+
write_type(ntt, ast::ann_tag(ty::expr_ann(expr)),
1749+
tup(new_tps, new_tyt._1));
1750+
17481751
fn mkann_fn(ty::t tyt, option::t[vec[ty::t]] tps, &ast::ann old_ann)
17491752
-> ast::ann {
17501753
ret ast::ann_type(ast::ann_tag(old_ann), tyt, tps, none[@ts_ann]);
@@ -2134,12 +2137,12 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
21342137

21352138
if (ty::def_has_ty_params(defn)) {
21362139
auto path_tpot = instantiate_path(fcx, pth, tpt, expr.span);
2140+
write_type(fcx.ccx.node_types, ast::ann_tag(old_ann),
2141+
path_tpot);
21372142
ret @fold::respan[ast::expr_](expr.span,
21382143
ast::expr_path(pth,
21392144
ast::ann_type(ast::ann_tag(old_ann), path_tpot._1,
21402145
path_tpot._0, none[@ts_ann])));
2141-
write_type(fcx.ccx.node_types, ast::ann_tag(old_ann),
2142-
path_tpot);
21432146
}
21442147

21452148
// The definition doesn't take type parameters. If the programmer

0 commit comments

Comments
 (0)