Skip to content

Commit d6fb470

Browse files
committed
Drop protected[this] from compiler codebase
1 parent aa7ac11 commit d6fb470

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

compiler/src/dotty/tools/dotc/Run.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
3939
* for type checking.
4040
* imports For each element of RootImports, an import context
4141
*/
42-
protected[this] def rootContext(implicit ctx: Context): Context = {
42+
protected def rootContext(implicit ctx: Context): Context = {
4343
ctx.initialize()(ctx)
4444
ctx.base.setPhasePlan(comp.phases)
4545
val rootScope = new MutableScope
@@ -66,7 +66,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
6666
/** The context created for this run */
6767
def runContext: Context = myCtx
6868

69-
protected[this] implicit def ctx: Context = myCtx
69+
protected implicit def ctx: Context = myCtx
7070
assert(ctx.runId <= Periods.MaxPossibleRunId)
7171

7272
private[this] var myUnits: List[CompilationUnit] = _

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@ object Types {
16681668

16691669
/** Instances of this class are cached and are proxies. */
16701670
abstract class CachedProxyType extends TypeProxy with CachedType {
1671-
protected[this] var myHash: Int = HashUnknown
1671+
protected var myHash: Int = HashUnknown
16721672
final def hash: Int = {
16731673
if (myHash == HashUnknown) {
16741674
myHash = computeHash(null)
@@ -2894,8 +2894,8 @@ object Types {
28942894

28952895
/** A trait that mixes in functionality for signature caching */
28962896
trait SignatureCachingType extends TermType {
2897-
protected[this] var mySignature: Signature = _
2898-
protected[this] var mySignatureRunId: Int = NoRunId
2897+
protected var mySignature: Signature = _
2898+
protected var mySignatureRunId: Int = NoRunId
28992899

29002900
protected def computeSignature(implicit ctx: Context): Signature
29012901

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Flags.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object Scala2Flags {
3232
final val BYNAMEPARAM = 1 << 16 // parameter is by name
3333
final val CONTRAVARIANT = 1 << 17 // symbol is a contravariant type variable
3434
final val ABSOVERRIDE = 1 << 18 // combination of abstract & override
35-
final val LOCAL = 1 << 19 // symbol is local to current class (i.e. private[this] or protected[this]
35+
final val LOCAL = 1 << 19 // symbol is local to current class (i.e. private[this] or protected
3636
// pre: PRIVATE or PROTECTED are also set
3737
final val JAVA = 1 << 20 // symbol was defined by a Java class
3838
final val STATIC = 1 << 23 // static field, method or class

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import scala.util.control.NonFatal
1515
import scala.annotation.switch
1616

1717
class PlainPrinter(_ctx: Context) extends Printer {
18-
protected[this] implicit def ctx: Context = _ctx.addMode(Mode.Printing)
19-
protected[this] def printDebug = ctx.settings.YprintDebug.value
18+
protected implicit def ctx: Context = _ctx.addMode(Mode.Printing)
19+
protected def printDebug = ctx.settings.YprintDebug.value
2020

2121
private[this] var openRecs: List[RecType] = Nil
2222

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
3535
private[this] var printPos = ctx.settings.YprintPos.value
3636
private[this] val printLines = ctx.settings.printLines.value
3737

38-
override protected[this] implicit def ctx: Context = myCtx
38+
override protected implicit def ctx: Context = myCtx
3939

4040
def withEnclosingDef(enclDef: Tree[? >: Untyped])(op: => Text): Text = {
4141
val savedCtx = myCtx

compiler/src/dotty/tools/dotc/reporting/StoreReporter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import diagnostic.messages._
2020
*/
2121
class StoreReporter(outer: Reporter) extends Reporter {
2222

23-
protected[this] var infos: mutable.ListBuffer[MessageContainer] = null
23+
protected var infos: mutable.ListBuffer[MessageContainer] = null
2424

2525
def doReport(m: MessageContainer)(implicit ctx: Context): Unit = {
2626
typr.println(s">>>> StoredError: ${m.message}") // !!! DEBUG

compiler/src/dotty/tools/repl/ReplCompiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ReplCompiler extends Compiler {
4141
def newRun(initCtx: Context, state: State): Run = new Run(this, initCtx) {
4242

4343
/** Import previous runs and user defined imports */
44-
override protected[this] def rootContext(implicit ctx: Context): Context = {
44+
override protected def rootContext(implicit ctx: Context): Context = {
4545
def importContext(imp: tpd.Import)(implicit ctx: Context) =
4646
ctx.importContext(imp, imp.symbol)
4747

compiler/src/dotty/tools/repl/ReplDriver.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class ReplDriver(settings: Array[String],
7878
* such, when the user enters `:reset` this method should be called to reset
7979
* everything properly
8080
*/
81-
protected[this] def resetToInitial(): Unit = {
81+
protected def resetToInitial(): Unit = {
8282
rootCtx = initialCtx
8383
if (rootCtx.settings.outputDir.isDefault(rootCtx))
8484
rootCtx = rootCtx.fresh
@@ -159,7 +159,7 @@ class ReplDriver(settings: Array[String],
159159
}
160160

161161
/** Extract possible completions at the index of `cursor` in `expr` */
162-
protected[this] final def completions(cursor: Int, expr: String, state0: State): List[Candidate] = {
162+
protected final def completions(cursor: Int, expr: String, state0: State): List[Candidate] = {
163163
def makeCandidate(completion: Completion) = {
164164
val displ = completion.label
165165
new Candidate(

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
351351
private[this] var _failureCount = 0
352352

353353
/** Fail the current test */
354-
protected[this] final def fail(failure: Failure = Generic): Unit = synchronized {
354+
protected final def fail(failure: Failure = Generic): Unit = synchronized {
355355
_failures = _failures + failure
356356
_failureCount = _failureCount + 1
357357
}

0 commit comments

Comments
 (0)