@@ -40,7 +40,6 @@ fn fold_fn(
40
40
let srv = fold. ctxt ;
41
41
42
42
{
43
- args: merge_arg_tys ( srv, doc. id ( ) , doc. args ) ,
44
43
return : merge_ret_ty ( srv, doc. id ( ) , doc. return ) ,
45
44
sig: get_fn_sig ( srv, doc. id ( ) )
46
45
with doc
@@ -134,22 +133,6 @@ fn should_add_native_fn_ret_types() {
134
133
assert doc. cratemod ( ) . nmods ( ) [ 0 ] . fns [ 0 ] . return . ty == some ( "int" ) ;
135
134
}
136
135
137
- fn merge_arg_tys (
138
- srv : astsrv:: srv ,
139
- fn_id : doc:: ast_id ,
140
- args : [ doc:: argdoc ]
141
- ) -> [ doc:: argdoc ] {
142
- let tys = get_arg_tys ( srv, fn_id) ;
143
- vec:: map2 ( args, tys) { |arg, ty|
144
- // Sanity check that we're talking about the same args
145
- assert arg. name == tuple:: first ( ty) ;
146
- {
147
- ty: some ( tuple:: second ( ty) )
148
- with arg
149
- }
150
- }
151
- }
152
-
153
136
fn get_arg_tys ( srv : astsrv:: srv , fn_id : doc:: ast_id ) -> [ ( str , str ) ] {
154
137
astsrv:: exec ( srv) { |ctxt|
155
138
alt check ctxt. ast_map . get ( fn_id) {
@@ -174,20 +157,6 @@ fn decl_arg_tys(decl: ast::fn_decl) -> [(str, str)] {
174
157
}
175
158
}
176
159
177
- #[ test]
178
- fn should_add_arg_types ( ) {
179
- let doc = test:: mk_doc ( "fn a(b: int, c: bool) { }" ) ;
180
- let fn_ = doc. cratemod ( ) . fns ( ) [ 0 ] ;
181
- assert fn_. args [ 0 ] . ty == some ( "int" ) ;
182
- assert fn_. args [ 1 ] . ty == some ( "bool" ) ;
183
- }
184
-
185
- #[ test]
186
- fn should_add_native_fn_arg_types ( ) {
187
- let doc = test:: mk_doc ( "native mod a { fn a(b: int); }" ) ;
188
- assert doc. cratemod ( ) . nmods ( ) [ 0 ] . fns [ 0 ] . args [ 0 ] . ty == some ( "int" ) ;
189
- }
190
-
191
160
fn fold_const (
192
161
fold : fold:: fold < astsrv:: srv > ,
193
162
doc : doc:: constdoc
@@ -260,7 +229,6 @@ fn fold_res(
260
229
let srv = fold. ctxt ;
261
230
262
231
{
263
- args: merge_arg_tys ( srv, doc. id ( ) , doc. args ) ,
264
232
sig: some ( astsrv:: exec ( srv) { |ctxt|
265
233
alt check ctxt. ast_map . get ( doc. id ( ) ) {
266
234
ast_map:: node_item ( @{
@@ -280,12 +248,6 @@ fn should_add_resource_sigs() {
280
248
assert doc. cratemod ( ) . resources ( ) [ 0 ] . sig == some ( "resource r(b: bool)" ) ;
281
249
}
282
250
283
- #[ test]
284
- fn should_add_resource_arg_tys ( ) {
285
- let doc = test:: mk_doc ( "resource r(a: bool) { }" ) ;
286
- assert doc. cratemod ( ) . resources ( ) [ 0 ] . args [ 0 ] . ty == some ( "bool" ) ;
287
- }
288
-
289
251
fn fold_iface (
290
252
fold : fold:: fold < astsrv:: srv > ,
291
253
doc : doc:: ifacedoc
@@ -303,11 +265,6 @@ fn merge_methods(
303
265
) -> [ doc:: methoddoc ] {
304
266
par:: anymap ( docs) { |doc|
305
267
{
306
- args: merge_method_arg_tys (
307
- srv,
308
- item_id,
309
- doc. args ,
310
- doc. name ) ,
311
268
return : merge_method_ret_ty (
312
269
srv,
313
270
item_id,
@@ -403,58 +360,6 @@ fn get_method_sig(
403
360
}
404
361
}
405
362
406
- fn merge_method_arg_tys (
407
- srv : astsrv:: srv ,
408
- item_id : doc:: ast_id ,
409
- args : [ doc:: argdoc ] ,
410
- method_name : str
411
- ) -> [ doc:: argdoc ] {
412
- let tys = get_method_arg_tys ( srv, item_id, method_name) ;
413
- vec:: map2 ( args, tys) { |arg, ty|
414
- assert arg. name == tuple:: first ( ty) ;
415
- {
416
- ty: some ( tuple:: second ( ty) )
417
- with arg
418
- }
419
- }
420
- }
421
-
422
- fn get_method_arg_tys (
423
- srv : astsrv:: srv ,
424
- item_id : doc:: ast_id ,
425
- method_name : str
426
- ) -> [ ( str , str ) ] {
427
- astsrv:: exec ( srv) { |ctxt|
428
- alt ctxt. ast_map . get ( item_id) {
429
- ast_map:: node_item ( @{
430
- node: ast:: item_iface ( _, methods) , _
431
- } , _) {
432
- alt vec:: find ( methods) { |method|
433
- method. ident == method_name
434
- } {
435
- some ( method) {
436
- decl_arg_tys ( method. decl )
437
- }
438
- _ { fail "get_method_arg_tys: expected method" ; }
439
- }
440
- }
441
- ast_map:: node_item ( @{
442
- node: ast:: item_impl ( _, _, _, methods) , _
443
- } , _) {
444
- alt vec:: find ( methods) { |method|
445
- method. ident == method_name
446
- } {
447
- some ( method) {
448
- decl_arg_tys ( method. decl )
449
- }
450
- _ { fail "get_method_arg_tys: expected method" ; }
451
- }
452
- }
453
- _ { fail }
454
- }
455
- }
456
- }
457
-
458
363
#[ test]
459
364
fn should_add_iface_method_sigs ( ) {
460
365
let doc = test:: mk_doc ( "iface i { fn a() -> int; }" ) ;
@@ -473,14 +378,6 @@ fn should_not_add_iface_method_nil_ret_type() {
473
378
assert doc. cratemod ( ) . ifaces ( ) [ 0 ] . methods [ 0 ] . return . ty == none;
474
379
}
475
380
476
- #[ test]
477
- fn should_add_iface_method_arg_types ( ) {
478
- let doc = test:: mk_doc ( "iface i { fn a(b: int, c: bool); }" ) ;
479
- let fn_ = doc. cratemod ( ) . ifaces ( ) [ 0 ] . methods [ 0 ] ;
480
- assert fn_. args [ 0 ] . ty == some ( "int" ) ;
481
- assert fn_. args [ 1 ] . ty == some ( "bool" ) ;
482
- }
483
-
484
381
fn fold_impl (
485
382
fold : fold:: fold < astsrv:: srv > ,
486
383
doc : doc:: impldoc
@@ -546,14 +443,6 @@ fn should_not_add_impl_method_nil_ret_type() {
546
443
assert doc. cratemod ( ) . impls ( ) [ 0 ] . methods [ 0 ] . return . ty == none;
547
444
}
548
445
549
- #[ test]
550
- fn should_add_impl_method_arg_types ( ) {
551
- let doc = test:: mk_doc ( "impl i for int { fn a(b: int, c: bool) { } }" ) ;
552
- let fn_ = doc. cratemod ( ) . impls ( ) [ 0 ] . methods [ 0 ] ;
553
- assert fn_. args [ 0 ] . ty == some ( "int" ) ;
554
- assert fn_. args [ 1 ] . ty == some ( "bool" ) ;
555
- }
556
-
557
446
fn fold_type (
558
447
fold : fold:: fold < astsrv:: srv > ,
559
448
doc : doc:: tydoc
0 commit comments