Skip to content

Commit 045dd7a

Browse files
committed
---
yaml --- r: 2566 b: refs/heads/master c: 1fc1ad9 h: refs/heads/master v: v3
1 parent 6eff7a6 commit 045dd7a

File tree

2 files changed

+4
-40
lines changed

2 files changed

+4
-40
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: 278d64dafce164122698a1c49ab340020aee17a5
2+
refs/heads/master: 1fc1ad91cebd17b9e502cfeecb51af593ef04d0e

trunk/src/comp/middle/typeck.rs

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,10 +1627,9 @@ fn resolve_local_types_in_block(&@fn_ctxt fcx, &ast::block block)
16271627

16281628
// AST fragment utilities
16291629

1630-
// FIXME: At the moment this works only for call, bind, and path expressions.
16311630
fn replace_expr_type(&node_type_table ntt,
16321631
&@ast::expr expr,
1633-
&tup(vec[ty::t], ty::t) new_tyt) -> @ast::expr {
1632+
&tup(vec[ty::t], ty::t) new_tyt) {
16341633
auto new_tps;
16351634
if (ty::expr_has_ty_params(ntt, expr)) {
16361635
new_tps = some[vec[ty::t]](new_tyt._0);
@@ -1640,41 +1639,6 @@ fn replace_expr_type(&node_type_table ntt,
16401639

16411640
write_type(ntt, ast::ann_tag(ty::expr_ann(expr)),
16421641
tup(new_tps, new_tyt._1));
1643-
1644-
fn mkann_fn(ty::t tyt, option::t[vec[ty::t]] tps, &ast::ann old_ann)
1645-
-> ast::ann {
1646-
ret ast::ann_type(ast::ann_tag(old_ann), tyt, tps, none[@ts_ann]);
1647-
}
1648-
1649-
auto mkann = bind mkann_fn(new_tyt._1, new_tps, _);
1650-
1651-
alt (expr.node) {
1652-
case (ast::expr_call(?callee, ?args, ?a)) {
1653-
ret @fold::respan(expr.span,
1654-
ast::expr_call(callee, args, mkann(a)));
1655-
}
1656-
case (ast::expr_self_method(?ident, ?a)) {
1657-
ret @fold::respan(expr.span,
1658-
ast::expr_self_method(ident, mkann(a)));
1659-
}
1660-
case (ast::expr_bind(?callee, ?args, ?a)) {
1661-
ret @fold::respan(expr.span,
1662-
ast::expr_bind(callee, args, mkann(a)));
1663-
}
1664-
case (ast::expr_field(?e, ?i, ?a)) {
1665-
ret @fold::respan(expr.span,
1666-
ast::expr_field(e, i, mkann(a)));
1667-
}
1668-
case (ast::expr_path(?p, ?a)) {
1669-
ret @fold::respan(expr.span,
1670-
ast::expr_path(p, mkann(a)));
1671-
}
1672-
case (_) {
1673-
log_err "unhandled expr type in replace_expr_type(): " +
1674-
util::common::expr_to_str(expr);
1675-
fail;
1676-
}
1677-
}
16781642
}
16791643

16801644

@@ -1891,9 +1855,9 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
18911855
fcx.ccx.node_types, f_0);
18921856
auto tpt_1 = Demand::full(fcx, f.span, tpt_0._1, t_0, tpt_0._0,
18931857
NO_AUTODEREF);
1894-
auto f_1 = replace_expr_type(fcx.ccx.node_types, f_0, tpt_1);
1858+
replace_expr_type(fcx.ccx.node_types, f_0, tpt_1);
18951859

1896-
ret tup(f_1, args_0);
1860+
ret tup(f_0, args_0);
18971861
}
18981862

18991863
// A generic function for checking assignment expressions

0 commit comments

Comments
 (0)