Skip to content

Commit

Permalink
Merge pull request #450 from paulstansifer/quick_error_message_fix_2
Browse files Browse the repository at this point in the history
Flatten functions and objects in trans::simplify_type.
  • Loading branch information
pcwalton committed Jun 3, 2011
2 parents cb61d7b + 20bd927 commit c515ed1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/comp/middle/trans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,20 @@ fn simplify_type(&@crate_ctxt ccx, &ty::t typ) -> ty::t {
case (ty::ty_vec(_)) {
ret ty::mk_imm_vec(ccx.tcx, ty::mk_nil(ccx.tcx));
}
case (ty::ty_fn(_,_,_,_)) {
ret ty::mk_imm_tup(ccx.tcx,
[ty::mk_imm_box(ccx.tcx,
ty::mk_nil(ccx.tcx)),
ty::mk_imm_box(ccx.tcx,
ty::mk_nil(ccx.tcx))]);
}
case (ty::ty_obj(_)) {
ret ty::mk_imm_tup(ccx.tcx,
[ty::mk_imm_box(ccx.tcx,
ty::mk_nil(ccx.tcx)),
ty::mk_imm_box(ccx.tcx,
ty::mk_nil(ccx.tcx))]);
}
case (_) { ret typ; }
}
}
Expand Down

0 comments on commit c515ed1

Please sign in to comment.