Skip to content

Commit 429b471

Browse files
Address review
1 parent 54f5144 commit 429b471

24 files changed

+88
-85
lines changed

compiler/src/dotty/tools/dotc/parsing/Scanners.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,5 +1003,5 @@ object Scanners {
10031003

10041004
// ------------- keyword configuration -----------------------------------
10051005

1006-
val ((lastKeywordStart: Int), (kwArray: Array[Int])) = buildKeywordArray(keywords)
1006+
private val ((lastKeywordStart: Int), (kwArray: Array[Int])) = buildKeywordArray(keywords)
10071007
}

compiler/src/dotty/tools/dotc/tastyreflect/TreeOpsImpl.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ trait TreeOpsImpl extends scala.tasty.reflect.TreeOps with TastyCoreImpl with He
8080
def ClassDefDeco(cdef: ClassDef): ClassDefAPI = new ClassDefAPI {
8181
private def rhs = cdef.rhs.asInstanceOf[tpd.Template]
8282
def constructor(implicit ctx: Context): DefDef = rhs.constr
83-
def parents(implicit ctx: Context): List[tpd.Tree] = rhs.parents
84-
def self(implicit ctx: Context): Option[tpd.ValDef] = optional(rhs.self)
85-
def body(implicit ctx: Context): List[tpd.Tree] = rhs.body
83+
def parents(implicit ctx: Context): List[Tree] = rhs.parents
84+
def self(implicit ctx: Context): Option[ValDef] = optional(rhs.self)
85+
def body(implicit ctx: Context): List[Tree] = rhs.body
8686
}
8787

8888
// DefDef

compiler/src/dotty/tools/dotc/transform/CapturedVars.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CapturedVars extends MiniPhase with IdentityDenotTransformer { thisPhase =
7171
}
7272
}
7373

74-
override def prepareForUnit(tree: Tree)(implicit ctx: Context): FreshContext = {
74+
override def prepareForUnit(tree: Tree)(implicit ctx: Context): Context = {
7575
val captured = (new CollectCaptured)
7676
.runOver(ctx.compilationUnit.tpdTree)(ctx.withPhase(thisPhase))
7777
ctx.fresh.updateStore(Captured, captured)

compiler/src/dotty/tools/dotc/transform/LambdaLift.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ object LambdaLift {
2929
private type SymSet = TreeSet[Symbol]
3030

3131
/** A map storing free variables of functions and classes */
32-
val free: mutable.LinkedHashMap[Symbol, SymSet] = new LinkedHashMap[Symbol, SymSet]
32+
val free: mutable.LinkedHashMap[Symbol, SymSet] = new LinkedHashMap
3333

3434
/** A map storing the free variable proxies of functions and classes.
3535
* For every function and class, this is a map from the free variables
@@ -56,7 +56,7 @@ object LambdaLift {
5656
private val outerParam = new HashMap[Symbol, Symbol]
5757

5858
/** Buffers for lifted out classes and methods, indexed by owner */
59-
val liftedDefs: mutable.HashMap[Symbol, mutable.ListBuffer[Tree]] = new HashMap[Symbol, mutable.ListBuffer[Tree]]
59+
val liftedDefs: mutable.HashMap[Symbol, mutable.ListBuffer[Tree]] = new HashMap
6060

6161
/** A flag to indicate whether new free variables have been found */
6262
private[this] var changedFreeVars: Boolean = _
@@ -516,7 +516,7 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisPhase =>
516516
override def initContext(ctx: FreshContext): Unit =
517517
Lifter = ctx.addLocation[Lifter]()
518518

519-
override def prepareForUnit(tree: Tree)(implicit ctx: Context): FreshContext =
519+
override def prepareForUnit(tree: Tree)(implicit ctx: Context): Context =
520520
ctx.fresh.updateStore(Lifter, new Lifter(thisPhase))
521521

522522
override def transformIdent(tree: Ident)(implicit ctx: Context): Tree = {

compiler/src/dotty/tools/dotc/transform/LazyVals.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Symbols._
1010
import Decorators._
1111
import NameKinds._
1212
import Types._
13+
import Flags.FlagSet
1314
import StdNames.nme
1415
import dotty.tools.dotc.transform.MegaPhase._
1516
import dotty.tools.dotc.ast.tpd
@@ -28,7 +29,7 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
2829
/** this map contains mutable state of transformation: OffsetDefs to be appended to companion object definitions,
2930
* and number of bits currently used */
3031
class OffsetInfo(var defs: List[Tree], var ord:Int)
31-
val appendOffsetDefs: mutable.Map[Symbol, OffsetInfo] = mutable.Map.empty[Symbol, OffsetInfo]
32+
private[this] val appendOffsetDefs: mutable.Map[Symbol, OffsetInfo] = mutable.Map.empty[Symbol, OffsetInfo]
3233

3334
override def phaseName: String = "lazyVals"
3435

@@ -40,10 +41,10 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
4041

4142
def transformer: LazyVals = new LazyVals
4243

43-
val containerFlags: Flags.FlagSet = Flags.Synthetic | Flags.Mutable | Flags.Lazy
44-
val initFlags: Flags.FlagSet = Flags.Synthetic | Flags.Method
44+
val containerFlags: FlagSet = Flags.Synthetic | Flags.Mutable | Flags.Lazy
45+
val initFlags: FlagSet = Flags.Synthetic | Flags.Method
4546

46-
val containerFlagsMask: Flags.FlagSet = Flags.Method | Flags.Lazy | Flags.Accessor | Flags.Module
47+
val containerFlagsMask: FlagSet = Flags.Method | Flags.Lazy | Flags.Accessor | Flags.Module
4748

4849
/** A map of lazy values to the fields they should null after initialization. */
4950
private[this] var lazyValNullables: IdentityHashMap[Symbol, mutable.ListBuffer[Symbol]] = _

compiler/src/dotty/tools/dotc/transform/MixinOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class MixinOps(cls: ClassSymbol, thisPhase: DenotTransformer)(implicit ctx: Cont
9898
final val PrivateOrAccessorOrDeferred: FlagSet = Private | Accessor | Deferred
9999

100100
def forwarder(target: Symbol): List[Type] => List[List[Tree]] => Tree =
101-
(targs: List[Type]) => (vrefss: List[List[Tree]]) =>
101+
targs => vrefss =>
102102
superRef(target).appliedToTypes(targs).appliedToArgss(vrefss)
103103

104104
private def competingMethodsIterator(meth: Symbol): Iterator[Symbol] = {

compiler/src/dotty/tools/dotc/transform/ShortcutImplicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ShortcutImplicits extends MiniPhase with IdentityDenotTransformer { thisPh
7171
DirectMeth = ctx.addLocation[MutableSymbolMap[Symbol]]()
7272

7373

74-
override def prepareForUnit(tree: Tree)(implicit ctx: Context): FreshContext =
74+
override def prepareForUnit(tree: Tree)(implicit ctx: Context): Context =
7575
ctx.fresh.updateStore(DirectMeth, newMutableSymbolMap[Symbol])
7676

7777

compiler/src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ class TreeChecker extends Phase with SymTransformer {
130130

131131
class Checker(phasesToCheck: Seq[Phase]) extends ReTyper with Checking {
132132

133-
val nowDefinedSyms: mutable.HashSet[Symbol] = new mutable.HashSet[Symbol]
134-
val everDefinedSyms: MutableSymbolMap[untpd.Tree] = newMutableSymbolMap[untpd.Tree]
133+
private[this] val nowDefinedSyms: mutable.HashSet[Symbol] = new mutable.HashSet[Symbol]
134+
private[this] val everDefinedSyms: MutableSymbolMap[untpd.Tree] = newMutableSymbolMap[untpd.Tree]
135135

136136
// don't check value classes after typer, as the constraint about constructors doesn't hold after transform
137137
override def checkDerivedValueClass(clazz: Symbol, stats: List[Tree])(implicit ctx: Context): Unit = ()

compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ abstract class Lifter {
7777
/** Lift arguments that are not-idempotent into ValDefs in buffer `defs`
7878
* and replace by the idents of so created ValDefs.
7979
*/
80-
def liftArgs(defs: mutable.ListBuffer[Tree], methRef: Type, args: List[Tree])(implicit ctx: Context): List[tpd.Tree] =
80+
def liftArgs(defs: mutable.ListBuffer[Tree], methRef: Type, args: List[Tree])(implicit ctx: Context): List[Tree] =
8181
methRef.widen match {
8282
case mt: MethodType =>
8383
(args, mt.paramNames, mt.paramInfos).zipped.map { (arg, name, tp) =>
@@ -143,7 +143,7 @@ object LiftImpure extends LiftImpure
143143
/** Lift all impure or complex arguments */
144144
class LiftComplex extends Lifter {
145145
def noLift(expr: tpd.Tree)(implicit ctx: Context): Boolean = tpd.isSimplyPure(expr)
146-
override def exprLifter: LiftToDefs.type = LiftToDefs
146+
override def exprLifter: Lifter = LiftToDefs
147147
}
148148
object LiftComplex extends LiftComplex
149149

compiler/src/dotty/tools/dotc/typer/Inferencing.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,8 @@ trait Inferencing { this: Typer =>
461461
/** An enumeration controlling the degree of forcing in "is-dully-defined" checks. */
462462
@sharable object ForceDegree {
463463
class Value(val appliesTo: TypeVar => Boolean, val minimizeAll: Boolean, val allowBottom: Boolean = true)
464-
val none: ForceDegree.Value = new Value(_ => false, minimizeAll = false)
465-
val all: ForceDegree.Value = new Value(_ => true, minimizeAll = false)
466-
val noBottom: ForceDegree.Value = new Value(_ => true, minimizeAll = false, allowBottom = false)
464+
val none: Value = new Value(_ => false, minimizeAll = false)
465+
val all: Value = new Value(_ => true, minimizeAll = false)
466+
val noBottom: Value = new Value(_ => true, minimizeAll = false, allowBottom = false)
467467
}
468468

0 commit comments

Comments
 (0)