@@ -1207,27 +1207,22 @@ fn gather_locals(&@crate_ctxt ccx, &ast::_fn f,
1207
1207
auto nvi = @mutable 0 ;
1208
1208
1209
1209
// Add object fields, if any.
1210
+ auto obj_fields = ~[ ] ;
1210
1211
alt ( get_obj_info( ccx) ) {
1211
- case ( some( ?oinfo) ) {
1212
+ some( ?oinfo) {
1212
1213
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; }
1227
1216
}
1228
1217
}
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) ) ;
1230
1224
}
1225
+
1231
1226
// Add formal parameters.
1232
1227
auto args = ty:: ty_fn_args( ccx. tcx, ty:: node_id_to_type( ccx. tcx, id) ) ;
1233
1228
auto i = 0 u;
0 commit comments