@@ -72,22 +72,16 @@ object Contexts {
72
72
def next = { val c = current; current = current.outer; c }
73
73
}
74
74
75
- /** Set the compiler callback, shared by all contexts with the same `base` */
76
- def setCompilerCallback (callback : CompilerCallback ): this .type = {
77
- base.compilerCallback = callback; this
78
- }
79
-
80
75
/** The outer context */
81
76
private [this ] var _outer : Context = _
82
77
protected def outer_= (outer : Context ) = _outer = outer
83
78
def outer : Context = _outer
84
79
85
- // protected def compilerCallback_=(callback: CompilerCallback) =
86
- // _compilerCallback = callback
87
- // def compilerCallback: CompilerCallback = _compilerCallback
88
- // def setCompilerCallback(callback: CompilerCallback): this.type = {
89
- // this.compilerCallback = callback; this
90
- // }
80
+ /** The compiler callback implementation, or null if no callback will be called. */
81
+ private [this ] var _compilerCallback : CompilerCallback = _
82
+ protected def compilerCallback_= (callback : CompilerCallback ) =
83
+ _compilerCallback = callback
84
+ def compilerCallback : CompilerCallback = _compilerCallback
91
85
92
86
/** The current context */
93
87
private [this ] var _period : Period = _
@@ -426,6 +420,7 @@ object Contexts {
426
420
abstract class FreshContext extends Context {
427
421
def setPeriod (period : Period ): this .type = { this .period = period; this }
428
422
def setMode (mode : Mode ): this .type = { this .mode = mode; this }
423
+ def setCompilerCallback (callback : CompilerCallback ): this .type = { this .compilerCallback = callback; this }
429
424
def setTyperState (typerState : TyperState ): this .type = { this .typerState = typerState; this }
430
425
def setReporter (reporter : Reporter ): this .type = setTyperState(typerState.withReporter(reporter))
431
426
def setNewTyperState : this .type = setTyperState(typerState.fresh(isCommittable = true ))
@@ -537,10 +532,6 @@ object Contexts {
537
532
538
533
/** The essential mutable state of a context base, collected into a common class */
539
534
class ContextState {
540
-
541
- /** The compiler callback implementation, or null if unset */
542
- var compilerCallback : CompilerCallback = _
543
-
544
535
// Symbols state
545
536
546
537
/** A counter for unique ids */
0 commit comments