Skip to content

Commit 3ac9d8b

Browse files
committed
---
yaml --- r: 4546 b: refs/heads/master c: 00b781e h: refs/heads/master v: v3
1 parent 05d06b5 commit 3ac9d8b

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
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: d2c1fbd218e305310c1774d2d5fa8557a74ab842
2+
refs/heads/master: 00b781e495e9b489d4038565903a56e8dfb8433c

trunk/src/comp/middle/typeck.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,15 +1582,14 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
15821582
}
15831583

15841584
// Check the arguments.
1585-
// TODO: iter2
15861585
let i = 0u;
15871586
for a_opt: option::t[@ast::expr] in args {
15881587
alt a_opt {
15891588
some(a) {
15901589
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);
15941593
}
15951594
none. { }
15961595
}
@@ -1836,16 +1835,16 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
18361835
if ty::def_has_ty_params(defn) {
18371836
let path_tpot = instantiate_path(fcx, pth, tpt, expr.span);
18381837
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) > 0u {
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) > 0u {
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);
18471847
}
1848-
write::ty_only_fixup(fcx, id, tpt.ty);
18491848
}
18501849
ast::expr_mac(_) { tcx.sess.bug("unexpanded macro"); }
18511850
ast::expr_fail(expr_opt) {
@@ -2493,7 +2492,6 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
24932492
for method: @ast::method in ao.methods {
24942493
check_method(fcx.ccx, method);
24952494
}
2496-
next_ty_var(fcx);
24972495

24982496
// Now remove the info from the stack.
24992497
ivec::pop[obj_info](fcx.ccx.obj_infos);

0 commit comments

Comments
 (0)