Skip to content

Commit bb623f1

Browse files
Linyxustgodzik
authored andcommitted
Improve the usage of inclusive language
Changes: - blacklist -> excludelist - whitelist -> allowlist Discussion: - scala#21988 - scala#22360 (comment)
1 parent c83d67c commit bb623f1

22 files changed

+301
-30
lines changed

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

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

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

+1-1
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ class ClassfileParser(
904904

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

909909
/** Parse inner classes. Expects `in.bp` to point to the superclass entry.
910910
* Restores the old `bp`.
@@ -1028,7 +1028,7 @@ class ClassfileParser(
10281028
report.error(s"Found a TASTY attribute with a length different from 16 in $classfile. This is likely a bug in the compiler. Please report.", NoSourcePosition)
10291029
}
10301030

1031-
if scan(tpnme.ScalaATTR) && !scalaUnpickleWhitelist.contains(classRoot.name)
1031+
if scan(tpnme.ScalaATTR) && !scalaUnpickleAllowlist.contains(classRoot.name)
10321032
&& !(classRoot.name.startsWith("Tuple") && classRoot.name.endsWith("$sp"))
10331033
&& !(classRoot.name.startsWith("Product") && classRoot.name.endsWith("$sp"))
10341034
then
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export-in-extension.scala
2+
i12456.scala
3+
i8623.scala
4+
i1642.scala
5+
i16696.scala
6+
constructor-proxy-values.scala
7+
i9328.scala
8+
i15414.scala
9+
i6796.scala
10+
i14013.scala
11+
toplevel-cyclic
12+
curried-dependent-ift.scala
13+
i17121.scala
14+
illegal-match-types.scala
15+
i13780-1.scala
16+
i20317a.scala
17+
i11226.scala
18+
i974.scala
19+
i13864.scala
20+
21+
# semantic db generation fails in the first compilation
22+
i1642.scala
23+
i15158.scala
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# cyclic reference crashes
2+
i4368.scala
3+
i827.scala
4+
cycles.scala
5+
i5332.scala
6+
i4369c.scala
7+
i1806.scala
8+
i0091-infpaths.scala
9+
exports.scala
10+
i14834.scala
11+
12+
# other type related crashes
13+
i4653.scala
14+
overrideClass.scala
15+
16+
# repeating <error> on a top level type definition
17+
i18750.scala
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## See #18882
2+
patmat.scala
3+
t9312.scala
4+
unapplySeq-implicit-arg.scala
5+
unapplySeq-implicit-arg2.scala
6+
unapplySeq-implicit-arg3.scala
7+
ScalaCheck.scala
8+
mutable-read8.scala
9+
TypeCast.scala
10+
global-cycle8.scala
11+
global-cycle6.scala
12+
i12544b.scala
13+
t9360.scala
14+
mutable-array.scala
15+
patmat-unapplySeq2.scala
16+
line-spacing.scala
17+
global-list.scala
18+
t5366.scala
19+
mutable-read7.scala
20+
t9115.scala
21+
Color.scala
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
i8752.scala
2+
f-interpolator-neg.scala # Additional: A pure expression does nothing in statement position
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
t7746.scala # order of exhaustivity suggestions differs
2+
t4408.scala # order of exhaustivity suggestions differs
3+
patmat-ortype.scala # order of exhaustivity suggestions differs
4+
i13003.scala # order of exhaustivity suggestions differs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## See #18882
2+
patmat.scala
3+
patmat-interpolator.scala
4+
unapplySeq-implicit-arg-pos.scala
5+
global-cycle11.scala
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
i94-nada.scala
2+
i1812.scala
3+
i1867.scala
4+
i3067.scala
5+
t2712-5.scala
6+
t284-pos.scala
7+
t3249
8+
t3486
9+
t3612.scala
10+
reference
11+
scala-days-2019-slides
12+
i7048e.scala
13+
i8052.scala
14+
tuple-filter.scala
15+
i7740a.scala
16+
i7740b.scala
17+
i6507b.scala
18+
i12299a.scala
19+
i13871.scala
20+
i15181.scala
21+
i15922.scala
22+
i15926.scala
23+
t5031_2.scala
24+
i16997.scala
25+
i7414.scala
26+
i17588.scala
27+
i8300.scala
28+
i9804.scala
29+
i13433.scala
30+
i16649-irrefutable.scala
31+
strict-pattern-bindings-3.0-migration.scala
32+
i17186b.scala
33+
i11982a.scala
34+
i17255
35+
i17735.scala
36+
37+
# Tree is huge and blows stack for printing Text
38+
i7034.scala
39+
40+
# Causes cyclic reference by interacting with compiler stdlib types
41+
stdlib
42+
43+
# Stale symbol: package object scala
44+
seqtype-cycle
45+
46+
# type of super reference changes due to late addition of Mirror.Singleton
47+
i939.scala
48+
i13332super.scala
49+
50+
# Match types
51+
i7872.scala
52+
i11236.scala
53+
i11247.scala
54+
i11250
55+
i9999.scala
56+
8649.scala
57+
12093.scala
58+
9757.scala
59+
9890.scala
60+
13491.scala
61+
7512.scala
62+
i6505.scala
63+
i15158.scala
64+
i15155.scala
65+
i15827.scala
66+
i17149.scala
67+
tuple-fold.scala
68+
mt-redux-norm.perspective.scala
69+
i18211.scala
70+
10867.scala
71+
named-tuples1.scala
72+
i20897.scala
73+
i20512.scala
74+
75+
# Opaque type
76+
i5720.scala
77+
78+
# Tuples
79+
toexproftuple.scala
80+
i7580.scala
81+
82+
# Nullability
83+
nullable.scala
84+
85+
# parameter untupling with overloaded functions (see comment in Applications.normArg)
86+
i7757.scala
87+
88+
# splice type tag dealiased in this reference
89+
i8651b.scala
90+
91+
# uneliminated @uncheckedVariance after pickling
92+
annot-bootstrap.scala
93+
94+
# interaction with Scala-2's implicitly
95+
i9793.scala
96+
97+
# lazy_implicit symbol has different position after pickling
98+
i8182.scala
99+
100+
# local lifted value in annotation argument has different position after pickling
101+
i2797a
102+
103+
# Late instantiation of type variable in tryInsertImplicitOnQualifier
104+
# allows to simplify a type that was already computed
105+
i13842.scala
106+
107+
# Position change under captureChecking
108+
boxmap-paper.scala
109+
110+
# Function types print different after unpickling since test mispredicts Feature.preFundsEnabled
111+
caps-universal.scala
112+
113+
# GADT cast applied to singleton type difference
114+
i4176-gadt.scala
115+
116+
# GADT difference
117+
i13974a.scala
118+
i15867.scala
119+
120+
java-inherited-type1
121+
122+
# recursion limit exceeded
123+
i7445b.scala
124+
125+
# more aggresive reduce projection makes a difference
126+
i15525.scala
127+
i19955a.scala
128+
i19955b.scala
129+
i20053b.scala
130+
131+
# alias types at different levels of dereferencing
132+
parsercombinators-givens.scala
133+
parsercombinators-givens-2.scala
134+
parsercombinators-ctx-bounds.scala
135+
parsercombinators-this.scala
136+
parsercombinators-arrow.scala
137+
parsercombinators-new-syntax.scala
138+
hylolib-deferred-given
139+
hylolib-cb
140+
hylolib
141+
142+
# typecheckErrors method unpickling
143+
i21415.scala
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Checkfile differences for equivalent type
2+
tasty-extractors-1
3+
tasty-extractors-2
4+
tasty-extractors-types
5+
type-print
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## Many of these tests fail because CompilationTests.pickling does not handle
2+
## tests containing java files correctly
3+
4+
derive-generic.scala
5+
eff-dependent.scala
6+
enum-java
7+
i5257.scala
8+
i7212
9+
i7868.scala
10+
i9011.scala
11+
i9473.scala
12+
i13433.scala
13+
i13433b.scala
14+
macros-in-same-project1
15+
mixin-forwarder-overload
16+
t10889
17+
t3452d
18+
t3452e
19+
t3452g
20+
t7374
21+
t8905
22+
tuple-drop.scala
23+
tuple-ops.scala
24+
tuple-ops.scala
25+
tuple-take.scala
26+
tuple-zip.scala
27+
tuples1.scala
28+
tuples1a.scala
29+
tuples1b.scala
30+
typeclass-derivation-doc-example.scala
31+
typeclass-derivation1.scala
32+
typeclass-derivation2.scala
33+
typeclass-derivation2a.scala
34+
typeclass-derivation2b.scala
35+
typeclass-derivation2c.scala
36+
typeclass-derivation2d.scala
37+
typeclass-derivation3.scala
38+
varargs-abstract
39+
zero-arity-case-class.scala
40+
i12194.scala
41+
i12753
42+
t6138
43+
t6138-2
44+
i12656.scala
45+
trait-static-forwarder
46+
i17255
47+
named-tuples-strawman-2.scala
48+
49+
# typecheckErrors method unpickling
50+
typeCheckErrors.scala
51+
i18150.scala
52+

compiler/test/dotty/tools/TestSources.scala

+8-9
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,27 @@ object TestSources {
1111

1212
// pos tests lists
1313

14-
def posFromTastyBlacklistFile: String = "compiler/test/dotc/pos-from-tasty.blacklist"
15-
def posTestPicklingBlacklistFile: String = "compiler/test/dotc/pos-test-pickling.blacklist"
14+
def posFromTastyExcludelistFile: String = "compiler/test/dotc/pos-from-tasty.excludelist"
15+
def posTestPicklingExcludelistFile: String = "compiler/test/dotc/pos-test-pickling.excludelist"
1616
def posTestRecheckExcludesFile: String = "compiler/test/dotc/pos-test-recheck.excludes"
1717
def posLazyValsAllowlistFile: String = "compiler/test/dotc/pos-lazy-vals-tests.allowlist"
1818
def posLintingAllowlistFile: String = "compiler/test/dotc/pos-linting.allowlist"
1919

20-
def posFromTastyBlacklisted: List[String] = loadList(posFromTastyBlacklistFile)
21-
def posTestPicklingBlacklisted: List[String] = loadList(posTestPicklingBlacklistFile)
20+
def posFromTastyExcludelisted: List[String] = loadList(posFromTastyExcludelistFile)
21+
def posTestPicklingExcludelisted: List[String] = loadList(posTestPicklingExcludelistFile)
2222
def posTestRecheckExcluded: List[String] = loadList(posTestRecheckExcludesFile)
2323
def posLazyValsAllowlist: List[String] = loadList(posLazyValsAllowlistFile)
2424
def posLintingAllowlist: List[String] = loadList(posLintingAllowlistFile)
2525

2626
// run tests lists
2727

28-
def runFromTastyBlacklistFile: String = "compiler/test/dotc/run-from-tasty.blacklist"
29-
def runTestPicklingBlacklistFile: String = "compiler/test/dotc/run-test-pickling.blacklist"
28+
def runFromTastyExcludelistFile: String = "compiler/test/dotc/run-from-tasty.excludelist"
29+
def runTestPicklingExcludelistFile: String = "compiler/test/dotc/run-test-pickling.excludelist"
3030
def runTestRecheckExcludesFile: String = "compiler/test/dotc/run-test-recheck.excludes"
3131
def runLazyValsAllowlistFile: String = "compiler/test/dotc/run-lazy-vals-tests.allowlist"
3232

33-
34-
def runFromTastyBlacklisted: List[String] = loadList(runFromTastyBlacklistFile)
35-
def runTestPicklingBlacklisted: List[String] = loadList(runTestPicklingBlacklistFile)
33+
def runFromTastyExcludelisted: List[String] = loadList(runFromTastyExcludelistFile)
34+
def runTestPicklingExcludelisted: List[String] = loadList(runTestPicklingExcludelistFile)
3635
def runTestRecheckExcluded: List[String] = loadList(runTestRecheckExcludesFile)
3736
def runLazyValsAllowlist: List[String] = loadList(runLazyValsAllowlistFile)
3837

compiler/test/dotty/tools/dotc/CompilationTests.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ class CompilationTests {
170170
@Test def pickling: Unit = {
171171
implicit val testGroup: TestGroup = TestGroup("testPickling")
172172
aggregateTests(
173-
compileFilesInDir("tests/pos", picklingOptions, FileFilter.exclude(TestSources.posTestPicklingBlacklisted)),
174-
compileFilesInDir("tests/run", picklingOptions, FileFilter.exclude(TestSources.runTestPicklingBlacklisted))
173+
compileFilesInDir("tests/pos", picklingOptions, FileFilter.exclude(TestSources.posTestPicklingExcludelisted)),
174+
compileFilesInDir("tests/run", picklingOptions, FileFilter.exclude(TestSources.runTestPicklingExcludelisted))
175175
).checkCompile()
176176
}
177177

compiler/test/dotty/tools/dotc/FromTastyTests.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class FromTastyTests {
2323

2424
implicit val testGroup: TestGroup = TestGroup("posTestFromTasty")
2525
compileTastyInDir(s"tests${JFile.separator}pos", defaultOptions,
26-
fromTastyFilter = FileFilter.exclude(TestSources.posFromTastyBlacklisted)
26+
fromTastyFilter = FileFilter.exclude(TestSources.posFromTastyExcludelisted)
2727
).checkCompile()
2828
}
2929

@@ -35,7 +35,7 @@ class FromTastyTests {
3535

3636
implicit val testGroup: TestGroup = TestGroup("runTestFromTasty")
3737
compileTastyInDir(s"tests${JFile.separator}run", defaultOptions,
38-
fromTastyFilter = FileFilter.exclude(TestSources.runFromTastyBlacklisted)
38+
fromTastyFilter = FileFilter.exclude(TestSources.runFromTastyExcludelisted)
3939
).checkRuns()
4040
}
4141
}

0 commit comments

Comments
 (0)