@@ -1582,15 +1582,14 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
1582
1582
}
1583
1583
1584
1584
// Check the arguments.
1585
- // TODO: iter2
1586
1585
let i = 0 u;
1587
1586
for a_opt: option:: t[ @ast:: expr] in args {
1588
1587
alt a_opt {
1589
1588
some( a) {
1590
1589
bot |= check_expr ( fcx, a) ;
1591
- demand:: full ( fcx, a. span , arg_tys. ( i) . ty ,
1592
- expr_ty ( fcx. ccx . tcx , a) , ~ [ ] ,
1593
- AUTODEREF_BLOCK_COERCE ) ;
1590
+ demand:: autoderef ( fcx, a. span , arg_tys. ( i) . ty ,
1591
+ expr_ty ( fcx. ccx . tcx , a) ,
1592
+ AUTODEREF_BLOCK_COERCE ) ;
1594
1593
}
1595
1594
none. { }
1596
1595
}
@@ -1836,16 +1835,16 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
1836
1835
if ty:: def_has_ty_params ( defn) {
1837
1836
let path_tpot = instantiate_path ( fcx, pth, tpt, expr. span ) ;
1838
1837
write:: ty_fixup ( fcx, id, path_tpot) ;
1839
- ret false;
1840
- }
1841
- // The definition doesn't take type parameters. If the programmer
1842
- // supplied some, that's an error.
1843
- if ivec:: len[ @ast:: ty] ( pth. node . types ) > 0 u {
1844
- tcx. sess . span_fatal ( expr. span ,
1845
- "this kind of value does not \
1846
- take type parameters") ;
1838
+ } else {
1839
+ // The definition doesn't take type parameters. If the programmer
1840
+ // supplied some, that's an error.
1841
+ if ivec:: len[ @ast:: ty] ( pth. node . types ) > 0 u {
1842
+ tcx. sess . span_fatal ( expr. span ,
1843
+ "this kind of value does not \
1844
+ take type parameters") ;
1845
+ }
1846
+ write:: ty_only_fixup ( fcx, id, tpt. ty ) ;
1847
1847
}
1848
- write:: ty_only_fixup ( fcx, id, tpt. ty ) ;
1849
1848
}
1850
1849
ast:: expr_mac ( _) { tcx. sess . bug ( "unexpanded macro" ) ; }
1851
1850
ast:: expr_fail ( expr_opt) {
@@ -2493,7 +2492,6 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
2493
2492
for method: @ast:: method in ao. methods {
2494
2493
check_method ( fcx. ccx , method) ;
2495
2494
}
2496
- next_ty_var ( fcx) ;
2497
2495
2498
2496
// Now remove the info from the stack.
2499
2497
ivec:: pop[ obj_info] ( fcx. ccx . obj_infos ) ;
0 commit comments