@@ -2500,16 +2500,29 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
2500
2500
// FLAGS //
2501
2501
// /////////////
2502
2502
2503
- extension FlagsOps on (self : Flags ) {
2503
+ /** Members of `Flag` */
2504
+ extension FlagsOps on (flags : Flags ) {
2504
2505
2505
2506
/** Is the given flag set a subset of this flag sets */
2506
- def is (that : Flags ): Boolean = internal.Flags_is (self )(that)
2507
+ def is (that : Flags ): Boolean = internal.Flags_is (flags )(that)
2507
2508
2508
2509
/** Union of the two flag sets */
2509
- def | (that : Flags ): Flags = internal.Flags_or (self )(that)
2510
+ def | (that : Flags ): Flags = internal.Flags_or (flags )(that)
2510
2511
2511
2512
/** Intersection of the two flag sets */
2512
- def & (that : Flags ): Flags = internal.Flags_and (self)(that)
2513
+ def & (that : Flags ): Flags = internal.Flags_and (flags)(that)
2514
+
2515
+ /** Shows the tree as extractors */
2516
+ def showExtractors (given ctx : Context ): String =
2517
+ new ExtractorsPrinter [self.type ](self).showFlags(flags)
2518
+
2519
+ /** Shows the tree as fully typed source code */
2520
+ def show (given ctx : Context ): String =
2521
+ flags.showWith(SyntaxHighlight .plain)
2522
+
2523
+ /** Shows the tree as fully typed source code */
2524
+ def showWith (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2525
+ new SourceCodePrinter [self.type ](self)(syntaxHighlight).showFlags(flags)
2513
2526
2514
2527
}
2515
2528
@@ -2693,25 +2706,6 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
2693
2706
def warning (msg : => String , source : SourceFile , start : Int , end : Int )(given ctx : Context ): Unit =
2694
2707
internal.warning(msg, source, start, end)
2695
2708
2696
- // ////////////
2697
- // PRINTERS //
2698
- // ////////////
2699
-
2700
- /** Adds `show` as an extension method of a `Flags` */
2701
- extension FlagsShowDeco on (flags : Flags ) {
2702
- /** Shows the tree as extractors */
2703
- def showExtractors (given ctx : Context ): String =
2704
- new ExtractorsPrinter [self.type ](self).showFlags(flags)
2705
-
2706
- /** Shows the tree as fully typed source code */
2707
- def show (given ctx : Context ): String =
2708
- flags.showWith(SyntaxHighlight .plain)
2709
-
2710
- /** Shows the tree as fully typed source code */
2711
- def showWith (syntaxHighlight : SyntaxHighlight )(given ctx : Context ): String =
2712
- new SourceCodePrinter [self.type ](self)(syntaxHighlight).showFlags(flags)
2713
- }
2714
-
2715
2709
2716
2710
// ////////////
2717
2711
// COMMENTS //
0 commit comments