Skip to content

Commit d4b43ce

Browse files
committed
---
yaml --- r: 4021 b: refs/heads/master c: 00f54b4 h: refs/heads/master i: 4019: 70cc899 v: v3
1 parent b058c1f commit d4b43ce

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 94c91382cd0ed1601aa1b90906b24e01ec3865f8
2+
refs/heads/master: 00f54b4a42f8403bb3ec07cacf0904c0636c096a

trunk/src/comp/middle/typeck.rs

+11-16
Original file line numberDiff line numberDiff line change
@@ -1207,27 +1207,22 @@ fn gather_locals(&@crate_ctxt ccx, &ast::_fn f,
12071207
auto nvi = @mutable 0;
12081208

12091209
// Add object fields, if any.
1210+
auto obj_fields = ~[];
12101211
alt (get_obj_info(ccx)) {
1211-
case (some(?oinfo)) {
1212+
some(?oinfo) {
12121213
alt (oinfo) {
1213-
case (regular_obj(?obj_fields, _)) {
1214-
for (ast::obj_field f in obj_fields) {
1215-
auto field_ty = ty::node_id_to_type(ccx.tcx, f.id);
1216-
assign(ccx.tcx, vb, locals, local_names, nvi, f.id,
1217-
f.ident, some(field_ty));
1218-
}
1219-
}
1220-
case (anon_obj(?obj_fields, _)) {
1221-
for (ast::obj_field f in obj_fields) {
1222-
auto field_ty = ty::node_id_to_type(ccx.tcx, f.id);
1223-
assign(ccx.tcx, vb, locals, local_names, nvi, f.id,
1224-
f.ident, some(field_ty));
1225-
}
1226-
}
1214+
regular_obj(?ofs, _) { obj_fields = ofs; }
1215+
anon_obj(?ofs, _) { obj_fields = ofs; }
12271216
}
12281217
}
1229-
case (none) {/* no fields */ }
1218+
none { /* no fields */ }
1219+
}
1220+
for (ast::obj_field f in obj_fields) {
1221+
auto field_ty = ty::node_id_to_type(ccx.tcx, f.id);
1222+
assign(ccx.tcx, vb, locals, local_names, nvi, f.id, f.ident,
1223+
some(field_ty));
12301224
}
1225+
12311226
// Add formal parameters.
12321227
auto args = ty::ty_fn_args(ccx.tcx, ty::node_id_to_type(ccx.tcx, id));
12331228
auto i = 0u;

0 commit comments

Comments
 (0)