@@ -2641,75 +2641,78 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
2641
2641
// ////////////
2642
2642
2643
2643
/** Adds `show` as an extension method of a `Tree` */
2644
- implicit class TreeShowDeco (tree : Tree ) {
2644
+ extension TreeShowDeco on (tree : Tree ) {
2645
2645
/** Shows the tree as extractors */
2646
2646
def showExtractors (given ctx : Context ): String =
2647
2647
new ExtractorsPrinter [self.type ](self).showTree(tree)
2648
2648
2649
2649
/** Shows the tree as fully typed source code */
2650
2650
def show (given ctx : Context ): String =
2651
- show (SyntaxHighlight .plain)
2651
+ tree.showWith (SyntaxHighlight .plain)
2652
2652
2653
2653
/** Shows the tree as fully typed source code */
2654
- def show (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2654
+ def showWith (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2655
2655
new SourceCodePrinter [self.type ](self)(syntaxHighlight).showTree(tree)
2656
2656
2657
2657
}
2658
2658
2659
2659
/** Adds `show` as an extension method of a `TypeOrBounds` */
2660
- implicit class TypeOrBoundsShowDeco (tpe : TypeOrBounds ) {
2660
+ extension TypeOrBoundsShowDeco on (tpe : TypeOrBounds ) {
2661
2661
/** Shows the tree as extractors */
2662
2662
def showExtractors (given ctx : Context ): String =
2663
2663
new ExtractorsPrinter [self.type ](self).showTypeOrBounds(tpe)
2664
2664
2665
2665
/** Shows the tree as fully typed source code */
2666
2666
def show (given ctx : Context ): String =
2667
- show (SyntaxHighlight .plain)
2667
+ tpe.showWith (SyntaxHighlight .plain)
2668
2668
2669
2669
/** Shows the tree as fully typed source code */
2670
- def show (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2670
+ def showWith (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2671
2671
new SourceCodePrinter [self.type ](self)(syntaxHighlight).showTypeOrBounds(tpe)
2672
2672
}
2673
2673
2674
2674
/** Adds `show` as an extension method of a `Constant` */
2675
- implicit class ConstantShowDeco (const : Constant ) {
2675
+ extension ConstantShowDeco on (const : Constant ) {
2676
2676
/** Shows the tree as extractors */
2677
2677
def showExtractors (given ctx : Context ): String =
2678
2678
new ExtractorsPrinter [self.type ](self).showConstant(const)
2679
2679
2680
2680
/** Shows the tree as fully typed source code */
2681
- def show (given ctx : Context ): String = show(SyntaxHighlight .plain)
2681
+ def show (given ctx : Context ): String =
2682
+ const.showWith(SyntaxHighlight .plain)
2682
2683
2683
2684
/** Shows the tree as fully typed source code */
2684
- def show (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2685
+ def showWith (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2685
2686
new SourceCodePrinter [self.type ](self)(syntaxHighlight).showConstant(const)
2686
2687
}
2687
2688
2688
2689
/** Adds `show` as an extension method of a `Symbol` */
2689
- implicit class SymbolShowDeco (symbol : Symbol ) {
2690
+ extension SymbolShowDeco on (symbol : Symbol ) {
2690
2691
/** Shows the tree as extractors */
2691
2692
def showExtractors (given ctx : Context ): String =
2692
2693
new ExtractorsPrinter [self.type ](self).showSymbol(symbol)
2693
2694
2694
2695
/** Shows the tree as fully typed source code */
2695
- def show (given ctx : Context ): String = show(SyntaxHighlight .plain)
2696
+ def show (given ctx : Context ): String =
2697
+ symbol.showWith(SyntaxHighlight .plain)
2696
2698
2697
2699
/** Shows the tree as fully typed source code */
2698
- def show (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2700
+ def showWith (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2699
2701
new SourceCodePrinter [self.type ](self)(syntaxHighlight).showSymbol(symbol)
2700
2702
}
2701
2703
2702
2704
/** Adds `show` as an extension method of a `Flags` */
2703
- implicit class FlagsShowDeco (flags : Flags ) {
2705
+ extension FlagsShowDeco on (flags : Flags ) {
2704
2706
/** Shows the tree as extractors */
2705
2707
def showExtractors (given ctx : Context ): String =
2706
2708
new ExtractorsPrinter [self.type ](self).showFlags(flags)
2707
2709
2708
2710
/** Shows the tree as fully typed source code */
2709
- def show (given ctx : Context ): String = show(SyntaxHighlight .plain)
2711
+ def show (given ctx : Context ): String =
2712
+ flags.showWith(SyntaxHighlight .plain)
2710
2713
2711
2714
/** Shows the tree as fully typed source code */
2712
- def show (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2715
+ def showWith (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2713
2716
new SourceCodePrinter [self.type ](self)(syntaxHighlight).showFlags(flags)
2714
2717
}
2715
2718
0 commit comments