Skip to content

Commit 50cd93d

Browse files
committed
---
yaml --- r: 11414 b: refs/heads/master c: 8015e6d h: refs/heads/master v: v3
1 parent 91e1a6a commit 50cd93d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ffd50b9cdfa38bc80f2444d917eef5a02c38c32f
2+
refs/heads/master: 8015e6d52b7eeea47f9e61c6ac42487935474ca4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/comp/middle/typeck.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,8 +1146,10 @@ mod writeback {
11461146
typ) {
11471147
fix_ok(new_type) { ret some(new_type); }
11481148
fix_err(vid) {
1149-
fcx.ccx.tcx.sess.span_err(sp, "cannot determine a type \
1150-
for this expression");
1149+
if !fcx.ccx.tcx.sess.has_errors() {
1150+
fcx.ccx.tcx.sess.span_err(sp, "cannot determine a type \
1151+
for this expression");
1152+
}
11511153
ret none;
11521154
}
11531155
}
@@ -2546,7 +2548,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
25462548
field, ty_to_str(tcx, t_err)];
25472549
tcx.sess.span_err(expr.span, msg);
25482550
// NB: Adding a bogus type to allow typechecking to continue
2549-
write_ty(tcx, id, ty::mk_nil(tcx));
2551+
write_ty(tcx, id, next_ty_var(fcx));
25502552
}
25512553
}
25522554
}

0 commit comments

Comments
 (0)