Skip to content

Commit 4c2432a

Browse files
committed
Simplify Flags.show
1 parent 3df32d4 commit 4c2432a

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,7 +2517,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
25172517
def is(that: Flags): Boolean = self.isAllOf(that)
25182518
def |(that: Flags): Flags = dotc.core.Flags.or(self, that) // TODO: Replace with dotc.core.Flags.|(self)(that) once extension names have stabilized
25192519
def &(that: Flags): Flags = dotc.core.Flags.and(self, that)// TODO: Replace with dotc.core.Flags.&(self)(that) once extension names have stabilized
2520-
def show(using printer: Printer[Flags]): String = printer.show(self)
2520+
def show: String = Extractors.showFlags(using QuotesImpl.this)(self)
25212521
end extension
25222522
end FlagsMethods
25232523

@@ -2706,10 +2706,6 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
27062706
def show(const: Constant): String =
27072707
Extractors.showConstant(using QuotesImpl.this)(const)
27082708

2709-
lazy val FlagsCombination: Printer[Flags] = new Printer[Flags]:
2710-
def show(flags: Flags): String =
2711-
Extractors.showFlags(using QuotesImpl.this)(flags)
2712-
27132709
end Printer
27142710
end reflect
27152711

library/src/scala/quoted/Quotes.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3564,7 +3564,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
35643564
def &(that: Flags): Flags
35653565

35663566
/** Shows the flags as a String */
3567-
def show(using Printer[Flags]): String
3567+
def show: String
35683568

35693569
end extension
35703570
}
@@ -4028,9 +4028,6 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
40284028
/** Default pinter for `Flags` used when calling `flags.show` */
40294029
given ConstantPrinter: Printer[Constant] = Printer.ConstantCase
40304030

4031-
/** Default pinter for `Flags` used when calling `flags.show` */
4032-
given FlagsPrinter: Printer[Flags] = Printer.FlagsCombination
4033-
40344031
/** Module object of `type Printer`.
40354032
* Contains custom printers such as `TreeCode`, `TreeAnsiCode`, `TreeCases`, `TypeReprCode`, ..., `SymbolFullName` and `FlagsCombination`.
40364033
*/
@@ -4079,8 +4076,6 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
40794076
/** Prints a pattern like representation of the `Constant`. */
40804077
def ConstantCase: Printer[Constant]
40814078

4082-
/** Prints compination of `Flags` that form this particular flag. */
4083-
def FlagsCombination: Printer[Flags]
40844079
}
40854080

40864081
}

0 commit comments

Comments
 (0)