@@ -573,7 +573,6 @@ fn visit_item_with_scope(e: @env, i: @ast::item,
573
573
}
574
574
ast:: item_class( tps, ifaces, members, ctor, m_dtor, _) {
575
575
v. visit_ty_params( tps, sc, v) ;
576
- // Can maybe skip this now that we require self on class fields
577
576
let class_scope = @cons( scope_item( i) , sc) ;
578
577
/* visit the constructor... */
579
578
let ctor_scope = @cons( scope_method( ctor. node. self_id, tps) ,
@@ -1061,7 +1060,7 @@ fn lookup_in_scope(e: env, &&sc: scopes, sp: span, name: ident, ns: namespace,
1061
1060
}
1062
1061
ast:: item_class( tps, _, members, ctor, _, _) {
1063
1062
if ns == ns_type {
1064
- ret lookup_in_ty_params( e, name, tps) ;
1063
+ ret lookup_in_ty_params( e, name, tps) ;
1065
1064
}
1066
1065
if ns == ns_val && name == it. ident {
1067
1066
ret some( ast:: def_fn( local_def( ctor. node. id) ,
@@ -1317,13 +1316,14 @@ fn found_def_item(i: @ast::item, ns: namespace) -> option<def> {
1317
1316
alt i. node {
1318
1317
ast:: item_const ( * ) {
1319
1318
if ns == ns_val {
1320
- ret some ( ast:: def_const ( local_def ( i. id ) ) ) ; }
1319
+ ret some ( ast:: def_const ( local_def ( i. id ) ) ) ;
1320
+ }
1321
1321
}
1322
1322
ast:: item_fn ( decl, _, _) {
1323
- if ns == ns_val {
1323
+ if ns == ns_val {
1324
1324
ret some ( ast:: def_fn ( local_def ( i. id ) , decl. purity ) ) ;
1325
- }
1326
- }
1325
+ }
1326
+ }
1327
1327
ast:: item_mod ( _) {
1328
1328
if ns == ns_module { ret some ( ast:: def_mod ( local_def ( i. id ) ) ) ; }
1329
1329
}
@@ -1342,9 +1342,16 @@ fn found_def_item(i: @ast::item, ns: namespace) -> option<def> {
1342
1342
_ { }
1343
1343
}
1344
1344
}
1345
- ast:: item_class( * ) {
1346
- if ns == ns_type {
1347
- ret some ( ast:: def_class ( local_def ( i. id ) ) ) ;
1345
+ ast:: item_class( _, _, _members, ct, _, _) {
1346
+ alt ns {
1347
+ ns_type {
1348
+ ret some( ast:: def_class ( local_def ( i. id ) ) ) ;
1349
+ }
1350
+ ns_val {
1351
+ ret some( ast:: def_fn ( local_def ( ct. node . id ) ,
1352
+ ast:: impure_fn) ) ;
1353
+ }
1354
+ ns_module { }
1348
1355
}
1349
1356
}
1350
1357
ast:: item_impl( * ) { /* ??? */ }
@@ -1653,14 +1660,6 @@ fn index_mod(md: ast::_mod) -> mod_index {
1653
1660
ast:: item_class( tps, _, items, ctor, _, _) {
1654
1661
// add the class name itself
1655
1662
add_to_index( index, it. ident, mie_item( it) ) ;
1656
- // add the constructor decl
1657
- add_to_index( index, it. ident,
1658
- mie_item ( @{ ident : it. ident, attrs : [ ] ,
1659
- id : ctor. node. id,
1660
- node :
1661
- item_fn( ctor. node. dec, tps, ctor. node. body) ,
1662
- vis : ast:: public,
1663
- span : ctor. node. body. span} ) ) ;
1664
1663
}
1665
1664
}
1666
1665
}
0 commit comments