Skip to content

Commit 075f5e6

Browse files
committed
chore: Consider source code as Scala 2 under -Ycompile-scala2-library
1 parent 9066923 commit 075f5e6

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

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

Lines changed: 3 additions & 1 deletion
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,

project/Scala2LibraryBootstrappedMiMaFilters.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,10 @@ object Scala2LibraryBootstrappedMiMaFilters {
6666
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.NoPositioner"),
6767
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.RelaxedPosition"),
6868
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.RelaxedPositioner"),
69-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.SortedMapOps.coll"),
70-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.TreeMap.empty"),
71-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.TreeMap.fromSpecific"),
72-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.ArrayBuilder#ofUnit.addAll"),
73-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.TreeMap.empty"),
74-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.TreeMap.fromSpecific"),
7569
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.ManifestFactory#NothingManifest.newArray"),
7670
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.ManifestFactory#NullManifest.newArray"),
7771
ProblemFilters.exclude[MissingFieldProblem]("scala.collection.ArrayOps#ReverseIterator.xs"),
7872
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.NonLocalReturnControl.value"),
79-
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.collection.immutable.SortedMapOps.coll"),
8073
) ++
8174
Seq( // DirectMissingMethodProblem
8275
"scala.collection.LinearSeqIterator#LazyCell.this",

0 commit comments

Comments
 (0)