@@ -566,14 +566,22 @@ impl<'self> TyVisitor for ReprVisitor<'self> {
566
566
true
567
567
}
568
568
569
- fn visit_fn_input ( & mut self , _i : uint , _mode : uint , _inner : * TyDesc ) -> bool {
570
- // FIXME: #8917: should print out the parameter types here, separated by commas
569
+ fn visit_fn_input ( & mut self , i : uint , _mode : uint , inner : * TyDesc ) -> bool {
570
+ if i != 0 {
571
+ self . writer . write ( ", " . as_bytes ( ) ) ;
572
+ }
573
+ let name = unsafe { ( * inner) . name } ;
574
+ self . writer . write ( name. as_bytes ( ) ) ;
571
575
true
572
576
}
573
577
574
- fn visit_fn_output ( & mut self , _retstyle : uint , _inner : * TyDesc ) -> bool {
578
+ fn visit_fn_output ( & mut self , _retstyle : uint , inner : * TyDesc ) -> bool {
575
579
self . writer . write ( ")" . as_bytes ( ) ) ;
576
- // FIXME: #8917: should print out the output type here, as `-> T`
580
+ let name = unsafe { ( * inner) . name } ;
581
+ if name != "()" {
582
+ self . writer . write ( " -> " . as_bytes ( ) ) ;
583
+ self . writer . write ( name. as_bytes ( ) ) ;
584
+ }
577
585
true
578
586
}
579
587
@@ -620,6 +628,8 @@ fn test_repr() {
620
628
use str;
621
629
use str:: Str ;
622
630
use rt:: io:: Decorator ;
631
+ use util:: swap;
632
+ use char:: is_alphabetic;
623
633
624
634
fn exact_test < T > ( t : & T , e : & str ) {
625
635
let mut m = io:: mem:: MemWriter :: new ( ) ;
@@ -674,7 +684,9 @@ fn test_repr() {
674
684
exact_test ( & ( 10u64 , ~"hello") ,
675
685
"(10u64, ~\" hello\" )" ) ;
676
686
677
- exact_test ( & ( & println) , "&fn()" ) ;
687
+ exact_test ( & println, "fn(&str)" ) ;
688
+ exact_test ( & swap :: < int > , "fn(&mut int, &mut int)" ) ;
689
+ exact_test ( & is_alphabetic, "fn(char) -> bool" ) ;
678
690
exact_test ( & ( ~5 as ~ToStr ) , "~to_str::ToStr:Send" ) ;
679
691
680
692
struct Foo ;
0 commit comments