@@ -551,13 +551,19 @@ impl<'self> TyVisitor for ReprVisitor<'self> {
551
551
}
552
552
553
553
fn visit_enter_fn ( & mut self , _purity : uint , _proto : uint ,
554
- _n_inputs : uint , _retstyle : uint ) -> bool { true }
554
+ _n_inputs : uint , _retstyle : uint ) -> bool {
555
+ self . writer . write ( "fn(" . as_bytes ( ) ) ;
556
+ true
557
+ }
555
558
556
559
fn visit_fn_input ( & mut self , _i : uint , _mode : uint , _inner : * TyDesc ) -> bool {
560
+ // FIXME: #8917: should print out the parameter types here, separated by commas
557
561
true
558
562
}
559
563
560
564
fn visit_fn_output ( & mut self , _retstyle : uint , _inner : * TyDesc ) -> bool {
565
+ self . writer . write ( ")" . as_bytes ( ) ) ;
566
+ // FIXME: #8917: should print out the output type here, as `-> T`
561
567
true
562
568
}
563
569
@@ -596,6 +602,7 @@ struct P {a: int, b: float}
596
602
597
603
#[ test]
598
604
fn test_repr ( ) {
605
+ use prelude:: * ;
599
606
use str;
600
607
use str:: Str ;
601
608
use rt:: io:: Decorator ;
@@ -653,6 +660,8 @@ fn test_repr() {
653
660
exact_test ( & ( 10u64 , ~"hello") ,
654
661
"(10u64, ~\" hello\" )" ) ;
655
662
663
+ exact_test ( & ( & println) , "&fn()" ) ;
664
+
656
665
struct Foo ;
657
666
exact_test ( & ( ~[ Foo , Foo ] ) , "~[repr::test_repr::Foo, repr::test_repr::Foo]" ) ;
658
667
}
0 commit comments