Skip to content

Commit 0f35729

Browse files
committed
Rename Empty -> empty in SimpleIdentityMap
It is already `empty` in SimpleIdentitySet. That way we use the same convention as in the stdlib. # Conflicts: # compiler/src/dotty/tools/dotc/util/LinearIdentityMap.scala
1 parent eb6bd31 commit 0f35729

File tree

11 files changed

+19
-19
lines changed

11 files changed

+19
-19
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ object Contexts {
289289
private def lookup(key: Phase | SourceFile): Context =
290290
util.Stats.record("Context.related.lookup")
291291
if related == null then
292-
related = SimpleIdentityMap.Empty
292+
related = SimpleIdentityMap.empty
293293
null
294294
else
295295
related(key)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ class Definitions {
16031603
valueTypeEnc(sym2.asClass.name) % valueTypeEnc(sym1.asClass.name) == 0
16041604

16051605
@tu lazy val specialErasure: SimpleIdentityMap[Symbol, ClassSymbol] =
1606-
SimpleIdentityMap.Empty[Symbol]
1606+
SimpleIdentityMap.empty[Symbol]
16071607
.updated(AnyClass, ObjectClass)
16081608
.updated(AnyValClass, ObjectClass)
16091609
.updated(SingletonClass, ObjectClass)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ final class ProperGadtConstraint private(
6565
import dotty.tools.dotc.config.Printers.{gadts, gadtsConstr}
6666

6767
def this() = this(
68-
myConstraint = new OrderingConstraint(SimpleIdentityMap.Empty, SimpleIdentityMap.Empty, SimpleIdentityMap.Empty),
69-
mapping = SimpleIdentityMap.Empty,
70-
reverseMapping = SimpleIdentityMap.Empty
68+
myConstraint = new OrderingConstraint(SimpleIdentityMap.empty, SimpleIdentityMap.empty, SimpleIdentityMap.empty),
69+
mapping = SimpleIdentityMap.empty,
70+
reverseMapping = SimpleIdentityMap.empty
7171
)
7272

7373
/** Exposes ConstraintHandling.subsumes */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ object OrderingConstraint {
105105
}
106106

107107
@sharable
108-
val empty = new OrderingConstraint(SimpleIdentityMap.Empty, SimpleIdentityMap.Empty, SimpleIdentityMap.Empty)
108+
val empty = new OrderingConstraint(SimpleIdentityMap.empty, SimpleIdentityMap.empty, SimpleIdentityMap.empty)
109109
}
110110

111111
import OrderingConstraint._

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,7 @@ object SymDenotations {
15691569
// ----- caches -------------------------------------------------------
15701570

15711571
private var myTypeParams: List[TypeSymbol] = null
1572-
private var fullNameCache: SimpleIdentityMap[QualifiedNameKind, Name] = SimpleIdentityMap.Empty
1572+
private var fullNameCache: SimpleIdentityMap[QualifiedNameKind, Name] = SimpleIdentityMap.empty
15731573

15741574
private var myMemberCache: IdentityHashMap[Name, PreDenotation] = null
15751575
private var myMemberCachePeriod: Period = Nowhere
@@ -2606,7 +2606,7 @@ object SymDenotations {
26062606
}
26072607

26082608
private class MemberNamesImpl(createdAt: Period) extends InheritedCacheImpl(createdAt) with MemberNames {
2609-
private var cache: SimpleIdentityMap[NameFilter, Set[Name]] = SimpleIdentityMap.Empty
2609+
private var cache: SimpleIdentityMap[NameFilter, Set[Name]] = SimpleIdentityMap.empty
26102610

26112611
final def isValid(using Context): Boolean =
26122612
cache != null && isValidAt(ctx.phase)
@@ -2619,7 +2619,7 @@ object SymDenotations {
26192619
*/
26202620
def invalidate(): Unit =
26212621
if (cache != null)
2622-
if (locked) cache = SimpleIdentityMap.Empty
2622+
if (locked) cache = SimpleIdentityMap.empty
26232623
else {
26242624
cache = null
26252625
invalidateDependents()

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ class ImportInfo(symf: Context ?=> Symbol,
9999
/** Compute info relating to the selector list */
100100
private def ensureInitialized(): Unit = if myExcluded == null then
101101
myExcluded = Set()
102-
myForwardMapping = SimpleIdentityMap.Empty
103-
myReverseMapping = SimpleIdentityMap.Empty
102+
myForwardMapping = SimpleIdentityMap.empty
103+
myReverseMapping = SimpleIdentityMap.empty
104104
for sel <- selectors do
105105
if sel.isWildcard then
106106
myWildcardImport = true
@@ -180,7 +180,7 @@ class ImportInfo(symf: Context ?=> Symbol,
180180
private var myUnimported: Symbol = _
181181

182182
private var myOwner: Symbol = null
183-
private var myResults: SimpleIdentityMap[TermName, java.lang.Boolean] = SimpleIdentityMap.Empty
183+
private var myResults: SimpleIdentityMap[TermName, java.lang.Boolean] = SimpleIdentityMap.empty
184184

185185
/** Does this import clause or a preceding import clause import `owner.feature`? */
186186
def featureImported(feature: TermName, owner: Symbol)(using Context): Boolean =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ object Inferencing {
438438
if (vmap1 eq vmap) vmap else propagate(vmap1)
439439
}
440440

441-
propagate(accu(SimpleIdentityMap.Empty, tp))
441+
propagate(accu(SimpleIdentityMap.empty, tp))
442442
}
443443
}
444444

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
10401040
}
10411041
}
10421042

1043-
extractBindVariance(SimpleIdentityMap.Empty, tpt.tpe)
1043+
extractBindVariance(SimpleIdentityMap.empty, tpt.tpe)
10441044
}
10451045

10461046
def addTypeBindings(typeBinds: TypeBindsMap)(using Context): Unit =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ object ProtoTypes {
246246
var typedArgs: List[Tree] = Nil
247247

248248
/** A map in which typed arguments can be stored to be later integrated in `typedArgs`. */
249-
var typedArg: SimpleIdentityMap[untpd.Tree, Tree] = SimpleIdentityMap.Empty
249+
var typedArg: SimpleIdentityMap[untpd.Tree, Tree] = SimpleIdentityMap.empty
250250

251251
/** The tupled or untupled version of this prototype, if it has been computed */
252252
var tupledDual: Type = NoType

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@ class Typer extends Namer
25942594

25952595
def typedStats(stats: List[untpd.Tree], exprOwner: Symbol)(using Context): (List[Tree], Context) = {
25962596
val buf = new mutable.ListBuffer[Tree]
2597-
var enumContexts: SimpleIdentityMap[Symbol, Context] = SimpleIdentityMap.Empty
2597+
var enumContexts: SimpleIdentityMap[Symbol, Context] = SimpleIdentityMap.empty
25982598
val initialNotNullInfos = ctx.notNullInfos
25992599
// A map from `enum` symbols to the contexts enclosing their definitions
26002600
@tailrec def traverse(stats: List[untpd.Tree])(using Context): (List[Tree], Context) = stats match {

0 commit comments

Comments
 (0)