Skip to content

Commit 3d0412f

Browse files
committed
Add parentheses to newMutableSymbolMap
1 parent 0b828e6 commit 3d0412f

22 files changed

+36
-36
lines changed

compiler/sjs/backend/sjs/JSPrimitives.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class JSPrimitives(ctx: Context) extends DottyPrimitives(ctx) {
5959
/** Initialize the primitive map */
6060
private def initJSPrimitives(implicit ctx: Context): Map[Symbol, Int] = {
6161

62-
val primitives = newMutableSymbolMap[Int]
62+
val primitives = newMutableSymbolMap[Int]()
6363

6464
// !!! Code duplicate with DottyPrimitives
6565
/** Add a primitive operation to the map */

compiler/src/dotty/tools/backend/jvm/GenBCode.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class GenBCode extends Phase {
4040
private val entryPoints = new mutable.HashSet[Symbol]()
4141
def registerEntryPoint(sym: Symbol) = entryPoints += sym
4242

43-
private val superCallsMap = newMutableSymbolMap[Set[ClassSymbol]]
43+
private val superCallsMap = newMutableSymbolMap[Set[ClassSymbol]]()
4444
def registerSuperCall(sym: Symbol, calls: ClassSymbol) = {
4545
val old = superCallsMap.getOrElse(sym, Set.empty)
4646
superCallsMap.update(sym, old + calls)

compiler/src/dotty/tools/backend/jvm/LabelDefs.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class LabelDefs extends MiniPhaseTransform {
120120
object collectLabelDefs extends TreeMap() {
121121

122122
// labelSymbol -> Defining tree
123-
val labelDefs = Symbols.newMutableSymbolMap[Tree]
123+
val labelDefs = Symbols.newMutableSymbolMap[Tree]()
124124

125125
def clear = {
126126
labelDefs.clear()

compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class DottyPrimitives(ctx: Context) {
128128
implicit val ctx = this.ctx
129129

130130
import core.Symbols.defn
131-
val primitives = core.Symbols.newMutableSymbolMap[Int]
131+
val primitives = core.Symbols.newMutableSymbolMap[Int]()
132132

133133
/** Add a primitive operation to the map */
134134
def addPrimitive(s: Symbol, code: Int): Unit = {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object Comments {
2424
*/
2525
class ContextDocstrings {
2626

27-
private[this] val _docstrings: MutableSymbolMap[Comment] = newMutableSymbolMap
27+
private[this] val _docstrings: MutableSymbolMap[Comment] = newMutableSymbolMap()
2828

2929
val templateExpander = new CommentExpander
3030

@@ -180,7 +180,7 @@ object Comments {
180180
protected def superComment(sym: Symbol)(implicit ctx: Context): Option[String] =
181181
allInheritedOverriddenSymbols(sym).iterator map (x => cookedDocComment(x)) find (_ != "")
182182

183-
private val cookedDocComments = newMutableSymbolMap[String]
183+
private val cookedDocComments = newMutableSymbolMap[String]()
184184

185185
/** The raw doc comment of symbol `sym`, minus usecase and define sections, augmented by
186186
* missing sections of an inherited doc comment.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ object Symbols {
741741
}
742742
}
743743

744-
@inline def newMutableSymbolMap[T]: MutableSymbolMap[T] =
744+
@inline def newMutableSymbolMap[T](): MutableSymbolMap[T] =
745745
new MutableSymbolMap(new java.util.IdentityHashMap[Symbol, T]())
746746

747747
}

compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class TreePickler(pickler: TastyPickler) {
2323
import pickler.nameBuffer.nameIndex
2424
import ast.tpd._
2525

26-
private val symRefs = Symbols.newMutableSymbolMap[Addr]
27-
private val forwardSymRefs = Symbols.newMutableSymbolMap[List[Addr]]
26+
private val symRefs = Symbols.newMutableSymbolMap[Addr]()
27+
private val forwardSymRefs = Symbols.newMutableSymbolMap[List[Addr]]()
2828
private val pickledTypes = new java.util.IdentityHashMap[Type, Any] // Value type is really Addr, but that's not compatible with null
2929

3030
private def withLength(op: => Unit) = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Bridges(root: ClassSymbol)(implicit ctx: Context) {
3333
private[this] var toBeRemoved = immutable.Set[Symbol]()
3434
private val bridges = mutable.ListBuffer[Tree]()
3535
private val bridgesScope = newScope
36-
private val bridgeTarget = newMutableSymbolMap[Symbol]
36+
private val bridgeTarget = newMutableSymbolMap[Symbol]()
3737

3838
/** Add a bridge between `member` and `other`, where `member` overrides `other`
3939
* before erasure, if the following conditions are satisfied.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class ExtensionMethods extends MiniPhaseTransform with DenotTransformer with Ful
139139
extensionMeth
140140
}
141141

142-
private val extensionDefs = newMutableSymbolMap[mutable.ListBuffer[Tree]]
142+
private val extensionDefs = newMutableSymbolMap[mutable.ListBuffer[Tree]]()
143143
// TODO: this is state and should be per-run
144144
// todo: check that when transformation finished map is empty
145145

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class NonLocalReturns extends MiniPhaseTransform { thisTransformer =>
3333
defn.NonLocalReturnControlType.appliedTo(argtype)
3434

3535
/** A hashmap from method symbols to non-local return keys */
36-
private val nonLocalReturnKeys = newMutableSymbolMap[TermSymbol]
36+
private val nonLocalReturnKeys = newMutableSymbolMap[TermSymbol]()
3737

3838
/** Return non-local return key for given method */
3939
private def nonLocalReturnKey(meth: Symbol)(implicit ctx: Context) =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ object OverridingPairs {
6767
}
6868

6969
private val subParents = {
70-
val subParents = newMutableSymbolMap[BitSet]
70+
val subParents = newMutableSymbolMap[BitSet]()
7171
for (bc <- base.info.baseClasses)
7272
subParents(bc) = BitSet(parents.indices.filter(parents(_).derivesFrom(bc)): _*)
7373
subParents

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ object PatternMatcher {
7676
/** A map from variable symbols to their defining trees
7777
* and from labels to their defining plans
7878
*/
79-
private val initializer = newMutableSymbolMap[Tree]
80-
private val labelled = newMutableSymbolMap[Plan]
79+
private val initializer = newMutableSymbolMap[Tree]()
80+
private val labelled = newMutableSymbolMap[Plan]()
8181

8282
private def newVar(rhs: Tree, flags: FlagSet): TermSymbol =
8383
ctx.newSymbol(ctx.owner, PatMatStdBinderName.fresh(), Synthetic | Case | flags,
@@ -529,7 +529,7 @@ object PatternMatcher {
529529
tests1.filter { case(test, outcome) => tests2.get(test) == Some(outcome) }
530530

531531
/** The tests with known outcomes valid at entry to label */
532-
val seenAtLabel = newMutableSymbolMap[SeenTests]
532+
val seenAtLabel = newMutableSymbolMap[SeenTests]()
533533

534534
class ElimRedundant(seenTests: SeenTests) extends PlanTransform {
535535
override def apply(plan: TestPlan): Plan = {
@@ -609,12 +609,12 @@ object PatternMatcher {
609609
type SeenVars = Map[RHS, TermSymbol]
610610

611611
/** The variables known at entry to label */
612-
val seenAtLabel = newMutableSymbolMap[SeenVars]
612+
val seenAtLabel = newMutableSymbolMap[SeenVars]()
613613

614614
/** Parameters of label; these are passed additional variables
615615
* which are known at all callsites.
616616
*/
617-
val paramsOfLabel = newMutableSymbolMap[SeenVars]
617+
val paramsOfLabel = newMutableSymbolMap[SeenVars]()
618618

619619
class Merge(seenVars: SeenVars) extends PlanTransform {
620620
override val treeMap = new TreeMap {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ShortcutImplicits extends MiniPhase with IdentityDenotTransformer { thisTr
6969
/** A map to cache mapping local methods to their direct counterparts.
7070
* A fresh map is created for each unit.
7171
*/
72-
private val directMeth = newMutableSymbolMap[Symbol]
72+
private val directMeth = newMutableSymbolMap[Symbol]()
7373

7474
/** Should `sym` get a ..$direct companion?
7575
* This is the case if (1) `sym` is a method with an implicit function type as final result type.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
6565
ctx.owner.enclosingClass != invalidEnclClass
6666

6767
/** List buffers for new accessor definitions, indexed by class */
68-
private val accDefs = newMutableSymbolMap[mutable.ListBuffer[Tree]]
68+
private val accDefs = newMutableSymbolMap[mutable.ListBuffer[Tree]]()
6969

7070
/** A super accessor call corresponding to `sel` */
7171
private def superAccessorCall(sel: Select)(implicit ctx: Context) = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class TreeChecker extends Phase with SymTransformer {
142142
class Checker(phasesToCheck: Seq[Phase]) extends ReTyper with Checking {
143143

144144
val nowDefinedSyms = new mutable.HashSet[Symbol]
145-
val everDefinedSyms = newMutableSymbolMap[untpd.Tree]
145+
val everDefinedSyms = newMutableSymbolMap[untpd.Tree]()
146146

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

compiler/src/dotty/tools/dotc/transform/localopt/Devalify.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ import transform.SymUtils._
2323
class Devalify extends Optimisation {
2424
import ast.tpd._
2525

26-
val timesUsed = newMutableSymbolMap[Int]
27-
val timesUsedAsType = newMutableSymbolMap[Int]
26+
val timesUsed = newMutableSymbolMap[Int]()
27+
val timesUsedAsType = newMutableSymbolMap[Int]()
2828

2929
val defined = mutable.HashSet[Symbol]()
30-
val usedInInnerClass = newMutableSymbolMap[Int]
30+
val usedInInnerClass = newMutableSymbolMap[Int]()
3131
// Either a duplicate or a read through series of immutable fields
32-
val copies = newMutableSymbolMap[Tree]
32+
val copies = newMutableSymbolMap[Tree]()
3333

3434
def clear(): Unit = {
3535
timesUsed.clear()

compiler/src/dotty/tools/dotc/transform/localopt/InlineLabelsCalledOnce.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import config.Printers.simplify
1515
class InlineLabelsCalledOnce extends Optimisation {
1616
import ast.tpd._
1717

18-
val timesUsed = newMutableSymbolMap[Int]
19-
val defined = newMutableSymbolMap[DefDef]
18+
val timesUsed = newMutableSymbolMap[Int]()
19+
val defined = newMutableSymbolMap[DefDef]()
2020

2121
def clear(): Unit = {
2222
timesUsed.clear()

compiler/src/dotty/tools/dotc/transform/localopt/InlineOptions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import scala.collection.mutable
1717
class InlineOptions extends Optimisation {
1818
import ast.tpd._
1919

20-
val somes = newMutableSymbolMap[Tree]
20+
val somes = newMutableSymbolMap[Tree]()
2121
val nones = mutable.HashSet[Symbol]()
2222

2323
def clear(): Unit = {

compiler/src/dotty/tools/dotc/transform/localopt/Jumpjump.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import core.Flags._
1818
class Jumpjump extends Optimisation {
1919
import ast.tpd._
2020

21-
val defined = newMutableSymbolMap[Symbol]
21+
val defined = newMutableSymbolMap[Symbol]()
2222

2323
def clear(): Unit = defined.clear()
2424

compiler/src/dotty/tools/dotc/transform/localopt/RemoveUnnecessaryNullChecks.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import scala.collection.mutable
2424

2525
val initializedVals = mutable.HashSet[Symbol]()
2626

27-
val checkGood = newMutableSymbolMap[Set[Symbol]]
27+
val checkGood = newMutableSymbolMap[Set[Symbol]]()
2828

2929
def clear(): Unit = {
3030
initializedVals.clear()

compiler/src/dotty/tools/dotc/transform/localopt/Valify.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ class Valify(val simplifyPhase: Simplify) extends Optimisation {
1616
import ast.tpd._
1717

1818
// Either a duplicate or a read through series of immutable fields.
19-
val defined: MutableSymbolMap[ValDef] = newMutableSymbolMap
19+
val defined: MutableSymbolMap[ValDef] = newMutableSymbolMap()
2020

21-
val firstRead: MutableSymbolMap[RefTree] = newMutableSymbolMap
21+
val firstRead: MutableSymbolMap[RefTree] = newMutableSymbolMap()
2222

23-
val firstWrite: MutableSymbolMap[Assign] = newMutableSymbolMap
23+
val firstWrite: MutableSymbolMap[Assign] = newMutableSymbolMap()
2424

25-
val secondWrite: MutableSymbolMap[Assign] = newMutableSymbolMap
25+
val secondWrite: MutableSymbolMap[Assign] = newMutableSymbolMap()
2626

2727
def clear(): Unit = {
2828
defined.clear()

compiler/src/dotty/tools/dotc/transform/localopt/Varify.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import scala.collection.mutable
2727
class Varify extends Optimisation {
2828
import ast.tpd._
2929

30-
val paramsTimesUsed = newMutableSymbolMap[Int]
30+
val paramsTimesUsed = newMutableSymbolMap[Int]()
3131

32-
val possibleRenames = newMutableSymbolMap[Set[Symbol]]
32+
val possibleRenames = newMutableSymbolMap[Set[Symbol]]()
3333

3434
def clear(): Unit = {
3535
paramsTimesUsed.clear()

0 commit comments

Comments
 (0)