Skip to content

Commit 7b7e58d

Browse files
committed
Drop Printers mixin of Contexts
1 parent 1ddc7a3 commit 7b7e58d

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

compiler/src/dotty/tools/dotc/core/Contexts.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ object Contexts {
107107
* of all class fields of type context; allow them only in whitelisted
108108
* classes (which should be short-lived).
109109
*/
110-
abstract class Context(val base: ContextBase)
111-
extends Printers { thiscontext =>
110+
abstract class Context(val base: ContextBase) { thiscontext =>
112111

113112
given Context = this
114113

@@ -221,6 +220,11 @@ object Contexts {
221220
/** The current plain printer */
222221
def printerFn: Context => Printer = store(printerFnLoc)
223222

223+
/** A function creating a printer */
224+
def printer: Printer =
225+
val pr = printerFn(this)
226+
if this.settings.YplainPrinter.value then pr.plain else pr
227+
224228
/** The current settings values */
225229
def settingsState: SettingsState = store(settingsStateLoc)
226230

compiler/src/dotty/tools/dotc/printing/Printers.scala

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)