Skip to content

Commit 1b817c3

Browse files
committed
chore: Consider source code as Scala 2 under -Ycompile-scala2-library
1 parent 7be5bfb commit 1b817c3

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
@@ -69,17 +69,10 @@ object Scala2LibraryBootstrappedMiMaFilters {
6969
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.NoPositioner"),
7070
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.RelaxedPosition"),
7171
ProblemFilters.exclude[FinalMethodProblem]("scala.io.Source.RelaxedPositioner"),
72-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.SortedMapOps.coll"),
73-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.TreeMap.empty"),
74-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.immutable.TreeMap.fromSpecific"),
75-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.ArrayBuilder#ofUnit.addAll"),
76-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.TreeMap.empty"),
77-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.collection.mutable.TreeMap.fromSpecific"),
7872
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.ManifestFactory#NothingManifest.newArray"),
7973
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.ManifestFactory#NullManifest.newArray"),
8074
ProblemFilters.exclude[MissingFieldProblem]("scala.collection.ArrayOps#ReverseIterator.xs"),
8175
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.NonLocalReturnControl.value"),
82-
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.collection.immutable.SortedMapOps.coll"),
8376
) ++
8477
Seq( // DirectMissingMethodProblem
8578
"scala.collection.LinearSeqIterator#LazyCell.this",

0 commit comments

Comments
 (0)