@@ -1595,6 +1595,21 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
1595
1595
/** Returns the type (Type) of T */
1596
1596
def typeOf [T ](given qtype : scala.quoted.Type [T ]): Type = qtype.unseal.tpe
1597
1597
1598
+ /** Members of `TypeOrBounds` */
1599
+ extension TypeOrBoundsOps on (tpe : TypeOrBounds ) {
1600
+ /** Shows the tree as extractors */
1601
+ def showExtractors (given ctx : Context ): String =
1602
+ new ExtractorsPrinter [self.type ](self).showTypeOrBounds(tpe)
1603
+
1604
+ /** Shows the tree as fully typed source code */
1605
+ def show (given ctx : Context ): String =
1606
+ tpe.showWith(SyntaxHighlight .plain)
1607
+
1608
+ /** Shows the tree as fully typed source code */
1609
+ def showWith (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
1610
+ new SourceCodePrinter [self.type ](self)(syntaxHighlight).showTypeOrBounds(tpe)
1611
+ }
1612
+
1598
1613
// ----- Types ----------------------------------------------------
1599
1614
1600
1615
extension TypeOps on (self : Type ) {
@@ -2669,21 +2684,6 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
2669
2684
// PRINTERS //
2670
2685
// ////////////
2671
2686
2672
- /** Adds `show` as an extension method of a `TypeOrBounds` */
2673
- extension TypeOrBoundsShowDeco on (tpe : TypeOrBounds ) {
2674
- /** Shows the tree as extractors */
2675
- def showExtractors (given ctx : Context ): String =
2676
- new ExtractorsPrinter [self.type ](self).showTypeOrBounds(tpe)
2677
-
2678
- /** Shows the tree as fully typed source code */
2679
- def show (given ctx : Context ): String =
2680
- tpe.showWith(SyntaxHighlight .plain)
2681
-
2682
- /** Shows the tree as fully typed source code */
2683
- def showWith (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2684
- new SourceCodePrinter [self.type ](self)(syntaxHighlight).showTypeOrBounds(tpe)
2685
- }
2686
-
2687
2687
/** Adds `show` as an extension method of a `Symbol` */
2688
2688
extension SymbolShowDeco on (symbol : Symbol ) {
2689
2689
/** Shows the tree as extractors */
0 commit comments