diff --git a/compiler/src/dotty/tools/dotc/core/Contexts.scala b/compiler/src/dotty/tools/dotc/core/Contexts.scala index bde23de135e4..8c09a3f24fa0 100644 --- a/compiler/src/dotty/tools/dotc/core/Contexts.scala +++ b/compiler/src/dotty/tools/dotc/core/Contexts.scala @@ -121,7 +121,7 @@ object Contexts { * risk of capturing complete trees. * - To make sure these rules are kept, it would be good to do a sanity * check using bytecode inspection with javap or scalap: Keep track - * of all class fields of type context; allow them only in whitelisted + * of all class fields of type context; allow them only in allowlisted * classes (which should be short-lived). */ abstract class Context(val base: ContextBase) { thiscontext => diff --git a/compiler/src/dotty/tools/dotc/core/Names.scala b/compiler/src/dotty/tools/dotc/core/Names.scala index 3f9667b08067..a31ab0662ee4 100644 --- a/compiler/src/dotty/tools/dotc/core/Names.scala +++ b/compiler/src/dotty/tools/dotc/core/Names.scala @@ -401,7 +401,7 @@ object Names { } /** It's OK to take a toString if the stacktrace does not contain a method - * from GenBCode or it also contains one of the whitelisted methods below. + * from GenBCode or it also contains one of the allowed methods below. */ private def toStringOK = { val trace: Array[StackTraceElement] = Thread.currentThread.nn.getStackTrace.asInstanceOf[Array[StackTraceElement]] diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index c20b6c73b1ea..37367ca56488 100644 --- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -904,7 +904,7 @@ class ClassfileParser( // Nothing$ and Null$ were incorrectly emitted with a Scala attribute // instead of ScalaSignature before 2.13.0-M2, see https://github.com/scala/scala/pull/5952 - private val scalaUnpickleWhitelist = List(tpnme.nothingClass, tpnme.nullClass) + private val scalaUnpickleAllowlist = List(tpnme.nothingClass, tpnme.nullClass) /** Parse inner classes. Expects `in.bp` to point to the superclass entry. * Restores the old `bp`. @@ -1028,7 +1028,7 @@ class ClassfileParser( 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) } - if scan(tpnme.ScalaATTR) && !scalaUnpickleWhitelist.contains(classRoot.name) + if scan(tpnme.ScalaATTR) && !scalaUnpickleAllowlist.contains(classRoot.name) && !(classRoot.name.startsWith("Tuple") && classRoot.name.endsWith("$sp")) && !(classRoot.name.startsWith("Product") && classRoot.name.endsWith("$sp")) then diff --git a/compiler/test/dotc/neg-best-effort-pickling.excludelist b/compiler/test/dotc/neg-best-effort-pickling.excludelist new file mode 100644 index 000000000000..99a83a467f08 --- /dev/null +++ b/compiler/test/dotc/neg-best-effort-pickling.excludelist @@ -0,0 +1,23 @@ +export-in-extension.scala +i12456.scala +i8623.scala +i1642.scala +i16696.scala +constructor-proxy-values.scala +i9328.scala +i15414.scala +i6796.scala +i14013.scala +toplevel-cyclic +curried-dependent-ift.scala +i17121.scala +illegal-match-types.scala +i13780-1.scala +i20317a.scala +i11226.scala +i974.scala +i13864.scala + +# semantic db generation fails in the first compilation +i1642.scala +i15158.scala diff --git a/compiler/test/dotc/neg-best-effort-unpickling.excludelist b/compiler/test/dotc/neg-best-effort-unpickling.excludelist new file mode 100644 index 000000000000..1e22d919f25a --- /dev/null +++ b/compiler/test/dotc/neg-best-effort-unpickling.excludelist @@ -0,0 +1,17 @@ +# cyclic reference crashes +i4368.scala +i827.scala +cycles.scala +i5332.scala +i4369c.scala +i1806.scala +i0091-infpaths.scala +exports.scala +i14834.scala + +# other type related crashes +i4653.scala +overrideClass.scala + +# repeating on a top level type definition +i18750.scala diff --git a/compiler/test/dotc/neg-init-global-scala2-library-tasty.excludelist b/compiler/test/dotc/neg-init-global-scala2-library-tasty.excludelist new file mode 100644 index 000000000000..03b020db64d9 --- /dev/null +++ b/compiler/test/dotc/neg-init-global-scala2-library-tasty.excludelist @@ -0,0 +1,21 @@ +## See #18882 +patmat.scala +t9312.scala +unapplySeq-implicit-arg.scala +unapplySeq-implicit-arg2.scala +unapplySeq-implicit-arg3.scala +ScalaCheck.scala +mutable-read8.scala +TypeCast.scala +global-cycle8.scala +global-cycle6.scala +i12544b.scala +t9360.scala +mutable-array.scala +patmat-unapplySeq2.scala +line-spacing.scala +global-list.scala +t5366.scala +mutable-read7.scala +t9115.scala +Color.scala \ No newline at end of file diff --git a/compiler/test/dotc/neg-scala2-library-tasty.excludelist b/compiler/test/dotc/neg-scala2-library-tasty.excludelist new file mode 100644 index 000000000000..d46a021ddd50 --- /dev/null +++ b/compiler/test/dotc/neg-scala2-library-tasty.excludelist @@ -0,0 +1,2 @@ +i8752.scala +f-interpolator-neg.scala # Additional: A pure expression does nothing in statement position diff --git a/compiler/test/dotc/patmat-exhaustivity-scala2-library-tasty.excludelist b/compiler/test/dotc/patmat-exhaustivity-scala2-library-tasty.excludelist new file mode 100644 index 000000000000..6f1717d532fd --- /dev/null +++ b/compiler/test/dotc/patmat-exhaustivity-scala2-library-tasty.excludelist @@ -0,0 +1,4 @@ +t7746.scala # order of exhaustivity suggestions differs +t4408.scala # order of exhaustivity suggestions differs +patmat-ortype.scala # order of exhaustivity suggestions differs +i13003.scala # order of exhaustivity suggestions differs diff --git a/compiler/test/dotc/pos-from-tasty.blacklist b/compiler/test/dotc/pos-from-tasty.excludelist similarity index 100% rename from compiler/test/dotc/pos-from-tasty.blacklist rename to compiler/test/dotc/pos-from-tasty.excludelist diff --git a/compiler/test/dotc/pos-init-global-scala2-library-tasty.excludelist b/compiler/test/dotc/pos-init-global-scala2-library-tasty.excludelist new file mode 100644 index 000000000000..eb60fc3b7c14 --- /dev/null +++ b/compiler/test/dotc/pos-init-global-scala2-library-tasty.excludelist @@ -0,0 +1,5 @@ +## See #18882 +patmat.scala +patmat-interpolator.scala +unapplySeq-implicit-arg-pos.scala +global-cycle11.scala diff --git a/compiler/test/dotc/pos-test-pickling.excludelist b/compiler/test/dotc/pos-test-pickling.excludelist new file mode 100644 index 000000000000..23c79affada0 --- /dev/null +++ b/compiler/test/dotc/pos-test-pickling.excludelist @@ -0,0 +1,143 @@ +i94-nada.scala +i1812.scala +i1867.scala +i3067.scala +t2712-5.scala +t284-pos.scala +t3249 +t3486 +t3612.scala +reference +scala-days-2019-slides +i7048e.scala +i8052.scala +tuple-filter.scala +i7740a.scala +i7740b.scala +i6507b.scala +i12299a.scala +i13871.scala +i15181.scala +i15922.scala +i15926.scala +t5031_2.scala +i16997.scala +i7414.scala +i17588.scala +i8300.scala +i9804.scala +i13433.scala +i16649-irrefutable.scala +strict-pattern-bindings-3.0-migration.scala +i17186b.scala +i11982a.scala +i17255 +i17735.scala + +# Tree is huge and blows stack for printing Text +i7034.scala + +# Causes cyclic reference by interacting with compiler stdlib types +stdlib + +# Stale symbol: package object scala +seqtype-cycle + +# type of super reference changes due to late addition of Mirror.Singleton +i939.scala +i13332super.scala + +# Match types +i7872.scala +i11236.scala +i11247.scala +i11250 +i9999.scala +8649.scala +12093.scala +9757.scala +9890.scala +13491.scala +7512.scala +i6505.scala +i15158.scala +i15155.scala +i15827.scala +i17149.scala +tuple-fold.scala +mt-redux-norm.perspective.scala +i18211.scala +10867.scala +named-tuples1.scala +i20897.scala +i20512.scala + +# Opaque type +i5720.scala + +# Tuples +toexproftuple.scala +i7580.scala + +# Nullability +nullable.scala + +# parameter untupling with overloaded functions (see comment in Applications.normArg) +i7757.scala + +# splice type tag dealiased in this reference +i8651b.scala + +# uneliminated @uncheckedVariance after pickling +annot-bootstrap.scala + +# interaction with Scala-2's implicitly +i9793.scala + +# lazy_implicit symbol has different position after pickling +i8182.scala + +# local lifted value in annotation argument has different position after pickling +i2797a + +# Late instantiation of type variable in tryInsertImplicitOnQualifier +# allows to simplify a type that was already computed +i13842.scala + +# Position change under captureChecking +boxmap-paper.scala + +# Function types print different after unpickling since test mispredicts Feature.preFundsEnabled +caps-universal.scala + +# GADT cast applied to singleton type difference +i4176-gadt.scala + +# GADT difference +i13974a.scala +i15867.scala + +java-inherited-type1 + +# recursion limit exceeded +i7445b.scala + +# more aggresive reduce projection makes a difference +i15525.scala +i19955a.scala +i19955b.scala +i20053b.scala + +# alias types at different levels of dereferencing +parsercombinators-givens.scala +parsercombinators-givens-2.scala +parsercombinators-ctx-bounds.scala +parsercombinators-this.scala +parsercombinators-arrow.scala +parsercombinators-new-syntax.scala +hylolib-deferred-given +hylolib-cb +hylolib + +# typecheckErrors method unpickling +i21415.scala diff --git a/compiler/test/dotc/run-from-tasty.blacklist b/compiler/test/dotc/run-from-tasty.excludelist similarity index 100% rename from compiler/test/dotc/run-from-tasty.blacklist rename to compiler/test/dotc/run-from-tasty.excludelist diff --git a/compiler/test/dotc/run-macros-scala2-library-tasty.excludelist b/compiler/test/dotc/run-macros-scala2-library-tasty.excludelist new file mode 100644 index 000000000000..6fdfccf7646c --- /dev/null +++ b/compiler/test/dotc/run-macros-scala2-library-tasty.excludelist @@ -0,0 +1,5 @@ +# Checkfile differences for equivalent type +tasty-extractors-1 +tasty-extractors-2 +tasty-extractors-types +type-print diff --git a/compiler/test/dotc/run-test-pickling.excludelist b/compiler/test/dotc/run-test-pickling.excludelist new file mode 100644 index 000000000000..c880a4b78f23 --- /dev/null +++ b/compiler/test/dotc/run-test-pickling.excludelist @@ -0,0 +1,52 @@ +## Many of these tests fail because CompilationTests.pickling does not handle +## tests containing java files correctly + +derive-generic.scala +eff-dependent.scala +enum-java +i5257.scala +i7212 +i7868.scala +i9011.scala +i9473.scala +i13433.scala +i13433b.scala +macros-in-same-project1 +mixin-forwarder-overload +t10889 +t3452d +t3452e +t3452g +t7374 +t8905 +tuple-drop.scala +tuple-ops.scala +tuple-ops.scala +tuple-take.scala +tuple-zip.scala +tuples1.scala +tuples1a.scala +tuples1b.scala +typeclass-derivation-doc-example.scala +typeclass-derivation1.scala +typeclass-derivation2.scala +typeclass-derivation2a.scala +typeclass-derivation2b.scala +typeclass-derivation2c.scala +typeclass-derivation2d.scala +typeclass-derivation3.scala +varargs-abstract +zero-arity-case-class.scala +i12194.scala +i12753 +t6138 +t6138-2 +i12656.scala +trait-static-forwarder +i17255 +named-tuples-strawman-2.scala + +# typecheckErrors method unpickling +typeCheckErrors.scala +i18150.scala + diff --git a/compiler/test/dotty/tools/TestSources.scala b/compiler/test/dotty/tools/TestSources.scala index 68a260de81e4..15cb0c741ede 100644 --- a/compiler/test/dotty/tools/TestSources.scala +++ b/compiler/test/dotty/tools/TestSources.scala @@ -11,28 +11,27 @@ object TestSources { // pos tests lists - def posFromTastyBlacklistFile: String = "compiler/test/dotc/pos-from-tasty.blacklist" - def posTestPicklingBlacklistFile: String = "compiler/test/dotc/pos-test-pickling.blacklist" + def posFromTastyExcludelistFile: String = "compiler/test/dotc/pos-from-tasty.excludelist" + def posTestPicklingExcludelistFile: String = "compiler/test/dotc/pos-test-pickling.excludelist" def posTestRecheckExcludesFile: String = "compiler/test/dotc/pos-test-recheck.excludes" def posLazyValsAllowlistFile: String = "compiler/test/dotc/pos-lazy-vals-tests.allowlist" def posLintingAllowlistFile: String = "compiler/test/dotc/pos-linting.allowlist" - def posFromTastyBlacklisted: List[String] = loadList(posFromTastyBlacklistFile) - def posTestPicklingBlacklisted: List[String] = loadList(posTestPicklingBlacklistFile) + def posFromTastyExcludelisted: List[String] = loadList(posFromTastyExcludelistFile) + def posTestPicklingExcludelisted: List[String] = loadList(posTestPicklingExcludelistFile) def posTestRecheckExcluded: List[String] = loadList(posTestRecheckExcludesFile) def posLazyValsAllowlist: List[String] = loadList(posLazyValsAllowlistFile) def posLintingAllowlist: List[String] = loadList(posLintingAllowlistFile) // run tests lists - def runFromTastyBlacklistFile: String = "compiler/test/dotc/run-from-tasty.blacklist" - def runTestPicklingBlacklistFile: String = "compiler/test/dotc/run-test-pickling.blacklist" + def runFromTastyExcludelistFile: String = "compiler/test/dotc/run-from-tasty.excludelist" + def runTestPicklingExcludelistFile: String = "compiler/test/dotc/run-test-pickling.excludelist" def runTestRecheckExcludesFile: String = "compiler/test/dotc/run-test-recheck.excludes" def runLazyValsAllowlistFile: String = "compiler/test/dotc/run-lazy-vals-tests.allowlist" - - def runFromTastyBlacklisted: List[String] = loadList(runFromTastyBlacklistFile) - def runTestPicklingBlacklisted: List[String] = loadList(runTestPicklingBlacklistFile) + def runFromTastyExcludelisted: List[String] = loadList(runFromTastyExcludelistFile) + def runTestPicklingExcludelisted: List[String] = loadList(runTestPicklingExcludelistFile) def runTestRecheckExcluded: List[String] = loadList(runTestRecheckExcludesFile) def runLazyValsAllowlist: List[String] = loadList(runLazyValsAllowlistFile) diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index f10e159beb86..71bf5a7e7844 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -170,8 +170,8 @@ class CompilationTests { @Test def pickling: Unit = { implicit val testGroup: TestGroup = TestGroup("testPickling") aggregateTests( - compileFilesInDir("tests/pos", picklingOptions, FileFilter.exclude(TestSources.posTestPicklingBlacklisted)), - compileFilesInDir("tests/run", picklingOptions, FileFilter.exclude(TestSources.runTestPicklingBlacklisted)) + compileFilesInDir("tests/pos", picklingOptions, FileFilter.exclude(TestSources.posTestPicklingExcludelisted)), + compileFilesInDir("tests/run", picklingOptions, FileFilter.exclude(TestSources.runTestPicklingExcludelisted)) ).checkCompile() } diff --git a/compiler/test/dotty/tools/dotc/FromTastyTests.scala b/compiler/test/dotty/tools/dotc/FromTastyTests.scala index 1d46cbbce95c..874088fb618e 100644 --- a/compiler/test/dotty/tools/dotc/FromTastyTests.scala +++ b/compiler/test/dotty/tools/dotc/FromTastyTests.scala @@ -23,7 +23,7 @@ class FromTastyTests { implicit val testGroup: TestGroup = TestGroup("posTestFromTasty") compileTastyInDir(s"tests${JFile.separator}pos", defaultOptions, - fromTastyFilter = FileFilter.exclude(TestSources.posFromTastyBlacklisted) + fromTastyFilter = FileFilter.exclude(TestSources.posFromTastyExcludelisted) ).checkCompile() } @@ -35,7 +35,7 @@ class FromTastyTests { implicit val testGroup: TestGroup = TestGroup("runTestFromTasty") compileTastyInDir(s"tests${JFile.separator}run", defaultOptions, - fromTastyFilter = FileFilter.exclude(TestSources.runFromTastyBlacklisted) + fromTastyFilter = FileFilter.exclude(TestSources.runFromTastyExcludelisted) ).checkRuns() } } diff --git a/compiler/test/dotty/tools/dotc/parsing/ScannerTest.scala b/compiler/test/dotty/tools/dotc/parsing/ScannerTest.scala index 659cd27e62f4..9f78d0778b41 100644 --- a/compiler/test/dotty/tools/dotc/parsing/ScannerTest.scala +++ b/compiler/test/dotty/tools/dotc/parsing/ScannerTest.scala @@ -10,7 +10,7 @@ import org.junit.Test class ScannerTest extends DottyTest { - val blackList = List( + val excluded = List( "/scaladoc/scala/tools/nsc/doc/html/page/Index.scala", "/scaladoc/scala/tools/nsc/doc/html/page/Template.scala" ) @@ -33,13 +33,13 @@ class ScannerTest extends DottyTest { def scanDir(path: String): Unit = scanDir(Directory(path)) def scanDir(dir: Directory): Unit = { - if (blackList exists (dir.jpath.toString endsWith _)) - println(s"blacklisted package: ${dir.toAbsolute.jpath}") + if (excluded exists (dir.jpath.toString endsWith _)) + println(s"excluded package: ${dir.toAbsolute.jpath}") else for (f <- dir.files) if (f.name.endsWith(".scala")) - if (blackList exists (f.jpath.toString endsWith _)) - println(s"blacklisted file: ${f.toAbsolute.jpath}") + if (excluded exists (f.jpath.toString endsWith _)) + println(s"excluded file: ${f.toAbsolute.jpath}") else scan(new PlainFile(f)) for (d <- dir.dirs) diff --git a/compiler/test/dotty/tools/vulpix/FileFilter.scala b/compiler/test/dotty/tools/vulpix/FileFilter.scala index b2aef8af038e..b59b4d4f209d 100644 --- a/compiler/test/dotty/tools/vulpix/FileFilter.scala +++ b/compiler/test/dotty/tools/vulpix/FileFilter.scala @@ -11,13 +11,13 @@ object FileFilter { exclude(file :: files.toList) def exclude(files: List[String]): FileFilter = new FileFilter { - private val blackList = files.toSet - def accept(file: String): Boolean = !blackList.contains(file) + private val excluded = files.toSet + def accept(file: String): Boolean = !excluded.contains(file) } def include(files: List[String]): FileFilter = new FileFilter { - private val whiteList = files.toSet - def accept(file: String): Boolean = whiteList.contains(file) + private val included = files.toSet + def accept(file: String): Boolean = included.contains(file) } object NoFilter extends FileFilter { diff --git a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala index f701a348d233..b4189deb805c 100644 --- a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala +++ b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala @@ -1499,7 +1499,7 @@ trait ParallelTesting extends RunnerOrchestration { self => | | sbt "testCompilation --from-tasty $file" | - |This tests can be disabled by adding `${file.getName}` to `compiler${JFile.separator}test${JFile.separator}dotc${JFile.separator}$runOrPos-$listName.blacklist` + |This tests can be disabled by adding `${file.getName}` to `compiler${JFile.separator}test${JFile.separator}dotc${JFile.separator}$runOrPos-$listName.excludelist` | |""".stripMargin } diff --git a/project/Build.scala b/project/Build.scala index 2e172a7e005a..7e0fe2b4c761 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1459,7 +1459,7 @@ object Build { ) }, - // A first blacklist of tests for those that do not compile or do not link + // A first excludelist of tests for those that do not compile or do not link (Test / managedSources) ++= { val dir = fetchScalaJSSource.value / "test-suite" diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/BasicSupport.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/BasicSupport.scala index a5e32c7332bd..81415377beeb 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/BasicSupport.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/BasicSupport.scala @@ -42,7 +42,7 @@ trait BasicSupport: def getAnnotations(): List[Annotation] = // Custom annotations should be documented only if annotated by @java.lang.annotation.Documented // We allow also some special cases - val fqNameWhitelist = Set( + val fqNameAllowlist = Set( "scala.specialized", "scala.throws", "scala.transient", @@ -56,7 +56,7 @@ trait BasicSupport: ) val documentedSymbol = summon[Quotes].reflect.Symbol.requiredClass("java.lang.annotation.Documented") val annotations = sym.annotations.filter { a => - a.tpe.typeSymbol.hasAnnotation(documentedSymbol) || fqNameWhitelist.contains(a.symbol.fullName) + a.tpe.typeSymbol.hasAnnotation(documentedSymbol) || fqNameAllowlist.contains(a.symbol.fullName) } annotations.map(parseAnnotation).reverse