@@ -566,14 +566,22 @@ impl<'self> TyVisitor for ReprVisitor<'self> {
566566 true
567567 }
568568
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 ( ) ) ;
571575 true
572576 }
573577
574- fn visit_fn_output ( & mut self , _retstyle : uint , _inner : * TyDesc ) -> bool {
578+ fn visit_fn_output ( & mut self , _retstyle : uint , inner : * TyDesc ) -> bool {
575579 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+ }
577585 true
578586 }
579587
@@ -620,6 +628,8 @@ fn test_repr() {
620628 use str;
621629 use str:: Str ;
622630 use rt:: io:: Decorator ;
631+ use util:: swap;
632+ use char:: is_alphabetic;
623633
624634 fn exact_test < T > ( t : & T , e : & str ) {
625635 let mut m = io:: mem:: MemWriter :: new ( ) ;
@@ -674,7 +684,9 @@ fn test_repr() {
674684 exact_test ( & ( 10u64 , ~"hello") ,
675685 "(10u64, ~\" hello\" )" ) ;
676686
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" ) ;
678690 exact_test ( & ( ~5 as ~ToStr ) , "~to_str::ToStr:Send" ) ;
679691
680692 struct Foo ;
0 commit comments