Skip to content

Commit 910fca9

Browse files
committed
Improve the usage of inclusive language
Changes: - blacklist -> excludelist - whitelist -> allowlist Discussion: - #21988 - #22360 (comment)
1 parent af655c9 commit 910fca9

28 files changed

+63
-63
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ object Contexts {
122122
* risk of capturing complete trees.
123123
* - To make sure these rules are kept, it would be good to do a sanity
124124
* check using bytecode inspection with javap or scalap: Keep track
125-
* of all class fields of type context; allow them only in whitelisted
125+
* of all class fields of type context; allow them only in allowlisted
126126
* classes (which should be short-lived).
127127
*/
128128
abstract class Context(val base: ContextBase) { thiscontext =>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,7 @@ class Definitions {
19571957
Some((args.init, args.last))
19581958
case _ => None
19591959

1960-
/** A whitelist of Scala-2 classes that are known to be pure */
1960+
/** A allowlist of Scala-2 classes that are known to be pure */
19611961
def isAssuredNoInits(sym: Symbol): Boolean =
19621962
(sym `eq` SomeClass) || isTupleClass(sym)
19631963

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ object Names {
401401
}
402402

403403
/** It's OK to take a toString if the stacktrace does not contain a method
404-
* from GenBCode or it also contains one of the whitelisted methods below.
404+
* from GenBCode or it also contains one of the allowed methods below.
405405
*/
406406
private def toStringOK = {
407407
val trace: Array[StackTraceElement] = Thread.currentThread.nn.getStackTrace.asInstanceOf[Array[StackTraceElement]]

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ class ClassfileParser(
10791079

10801080
// Nothing$ and Null$ were incorrectly emitted with a Scala attribute
10811081
// instead of ScalaSignature before 2.13.0-M2, see https://github.com/scala/scala/pull/5952
1082-
private val scalaUnpickleWhitelist = List(tpnme.nothingClass, tpnme.nullClass)
1082+
private val scalaUnpickleAllowlist = List(tpnme.nothingClass, tpnme.nullClass)
10831083

10841084
/** Parse inner classes. Expects `in.bp` to point to the superclass entry.
10851085
* Restores the old `bp`.
@@ -1152,7 +1152,7 @@ class ClassfileParser(
11521152
return None
11531153
}
11541154

1155-
if scan(tpnme.ScalaATTR) && !scalaUnpickleWhitelist.contains(classRoot.name)
1155+
if scan(tpnme.ScalaATTR) && !scalaUnpickleAllowlist.contains(classRoot.name)
11561156
&& !(classRoot.name.startsWith("Tuple") && classRoot.name.endsWith("$sp"))
11571157
&& !(classRoot.name.startsWith("Product") && classRoot.name.endsWith("$sp"))
11581158
then

compiler/src/dotty/tools/dotc/transform/init/Objects.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Objects(using Context @constructorOnly):
8282
val immutableLazyList: Symbol = requiredModule("scala.collection.immutable.LazyList")
8383
val LazyList_empty: Symbol = immutableLazyList.requiredValue("_empty")
8484

85-
val whiteList: Set[Symbol] = Set(SetNode_EmptySetNode, HashSet_EmptySet, Vector_EmptyIterator, MapNode_EmptyMapNode, HashMap_EmptyMap, LazyList_empty)
85+
val allowList: Set[Symbol] = Set(SetNode_EmptySetNode, HashSet_EmptySet, Vector_EmptyIterator, MapNode_EmptyMapNode, HashMap_EmptyMap, LazyList_empty)
8686

8787
// ----------------------------- abstract domain -----------------------------
8888

@@ -1728,7 +1728,7 @@ class Objects(using Context @constructorOnly):
17281728
tpl.body.foreach {
17291729
case vdef : ValDef if !vdef.symbol.is(Flags.Lazy) && !vdef.rhs.isEmpty =>
17301730
val sym = vdef.symbol
1731-
val res = if (whiteList.contains(sym)) Bottom else eval(vdef.rhs, thisV, klass)
1731+
val res = if (allowList.contains(sym)) Bottom else eval(vdef.rhs, thisV, klass)
17321732
if sym.is(Flags.Mutable) then
17331733
val addr = Heap.fieldVarAddr(summon[Regions.Data], sym, State.currentObject)
17341734
thisV.initVar(sym, addr)

0 commit comments

Comments
 (0)