@@ -1627,10 +1627,9 @@ fn resolve_local_types_in_block(&@fn_ctxt fcx, &ast::block block)
1627
1627
1628
1628
// AST fragment utilities
1629
1629
1630
- // FIXME: At the moment this works only for call, bind, and path expressions.
1631
1630
fn replace_expr_type( & node_type_table ntt,
1632
1631
& @ast:: expr expr,
1633
- & tup( vec[ ty:: t] , ty:: t) new_tyt) -> @ast :: expr {
1632
+ & tup( vec[ ty:: t] , ty:: t) new_tyt) {
1634
1633
auto new_tps;
1635
1634
if ( ty:: expr_has_ty_params( ntt, expr) ) {
1636
1635
new_tps = some[ vec[ ty:: t] ] ( new_tyt. _0) ;
@@ -1640,41 +1639,6 @@ fn replace_expr_type(&node_type_table ntt,
1640
1639
1641
1640
write_type( ntt, ast:: ann_tag( ty:: expr_ann( expr) ) ,
1642
1641
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
- }
1678
1642
}
1679
1643
1680
1644
@@ -1891,9 +1855,9 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) -> @ast::expr {
1891
1855
fcx. ccx. node_types, f_0) ;
1892
1856
auto tpt_1 = Demand :: full( fcx, f. span, tpt_0. _1, t_0, tpt_0. _0,
1893
1857
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) ;
1895
1859
1896
- ret tup( f_1 , args_0) ;
1860
+ ret tup( f_0 , args_0) ;
1897
1861
}
1898
1862
1899
1863
// A generic function for checking assignment expressions
0 commit comments