Skip to content

Commit 312fe0d

Browse files
committed
chore: Consider source code as Scala 2 under -Ycompile-scala2-library
1 parent 81e057a commit 312fe0d

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

Diff for: compiler/src/dotty/tools/dotc/typer/Namer.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ class Namer { typer: Typer =>
246246

247247
tree match {
248248
case tree: TypeDef if tree.isClassDef =>
249-
val flags = checkFlags(tree.mods.flags)
249+
var flags = checkFlags(tree.mods.flags)
250+
if ctx.settings.YcompileScala2Library.value then
251+
flags |= Scala2x
250252
val name = checkNoConflict(tree.name, flags.is(Private), tree.span).asTypeName
251253
val cls =
252254
createOrRefine[ClassSymbol](tree, name, flags, ctx.owner,

Diff for: project/Scala2LibraryBootstrappedMiMaFilters.scala

-7
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,10 @@ object Scala2LibraryBootstrappedMiMaFilters {
5656
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.NoPositioner"),
5757
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.RelaxedPosition"),
5858
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.RelaxedPositioner"),
59-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.SortedMapOps.coll"),
60-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.TreeMap.empty"),
61-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.TreeMap.fromSpecific"),
62-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.ArrayBuilder#ofUnit.addAll"),
63-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.TreeMap.empty"),
64-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.TreeMap.fromSpecific"),
6559
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.ManifestFactory#NothingManifest.newArray"),
6660
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.ManifestFactory#NullManifest.newArray"),
6761
ProblemFilters.exclude[MissingFieldProblem]("scala.collection.ArrayOps#ReverseIterator.xs"),
6862
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.NonLocalReturnControl.value"),
69-
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.collection.immutable.SortedMapOps.coll"),
7063
) ++
7164
Seq( // DirectMissingMethodProblem
7265
"scala.collection.LinearSeqIterator#LazyCell.this",

0 commit comments

Comments
 (0)