@@ -320,26 +320,6 @@ fn check_method(ccx: @crate_ctxt, method: @ast::method, self_ty: ty::t) {
320
320
check_bare_fn ( ccx, method. decl , method. body , method. id , some ( self_ty) ) ;
321
321
}
322
322
323
- fn class_types ( ccx : @crate_ctxt , members : [ @ast:: class_member ] ,
324
- rp : ast:: region_param ) -> class_map {
325
-
326
- let rslt = int_hash :: < ty:: t > ( ) ;
327
- let rs = rscope:: type_rscope ( rp) ;
328
- for members. each { |m|
329
- alt m. node {
330
- ast : : instance_var( _, t, _, id, _) {
331
- rslt. insert( id, ccx. to_ty( rs, t) ) ;
332
- }
333
- ast:: class_method( mth) {
334
- rslt. insert ( mth. id ,
335
- ty:: mk_fn ( ccx. tcx ,
336
- collect:: ty_of_method ( ccx, mth, rp) . fty ) ) ;
337
- }
338
- }
339
- }
340
- rslt
341
- }
342
-
343
323
fn check_class_member ( ccx : @crate_ctxt , class_t : ty:: t ,
344
324
cm : @ast:: class_member ) {
345
325
alt cm. node {
@@ -368,30 +348,25 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
368
348
for ms. each { |m| check_method( ccx, m, self_ty) ; }
369
349
}
370
350
ast:: item_class ( tps, ifaces, members, ctor, m_dtor, rp) {
371
- let cid = some ( it . id ) , tcx = ccx. tcx ;
351
+ let tcx = ccx. tcx ;
372
352
let class_t = ty:: node_id_to_type ( tcx, it. id ) ;
373
- let members_info = class_types ( ccx, members, rp) ;
374
- // can also ditch the enclosing_class stuff once we move to self
375
- // FIXME
376
- let class_ccx = @{ enclosing_class_id: cid,
377
- enclosing_class: members_info with * ccx} ;
378
353
// typecheck the ctor
379
- check_bare_fn ( class_ccx , ctor. node . dec ,
354
+ check_bare_fn ( ccx , ctor. node . dec ,
380
355
ctor. node . body , ctor. node . id ,
381
356
some ( class_t) ) ;
382
357
// Write the ctor's self's type
383
358
write_ty_to_tcx ( tcx, ctor. node . self_id , class_t) ;
384
359
385
360
option:: iter ( m_dtor) { |dtor|
386
361
// typecheck the dtor
387
- check_bare_fn ( class_ccx , ast_util:: dtor_dec ( ) ,
362
+ check_bare_fn ( ccx , ast_util:: dtor_dec ( ) ,
388
363
dtor. node . body , dtor. node . id ,
389
364
some ( class_t) ) ;
390
365
// Write the dtor's self's type
391
366
write_ty_to_tcx ( tcx, dtor. node . self_id , class_t) ;
392
367
} ;
393
368
// typecheck the members
394
- for members. each { |m| check_class_member( class_ccx , class_t, m) ; }
369
+ for members. each { |m| check_class_member( ccx , class_t, m) ; }
395
370
// Check that there's at least one field
396
371
let ( fields, _) = split_class_items ( members) ;
397
372
if fields. len ( ) < 1 u {
0 commit comments