diff --git a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala index e0fe17755257..32ab8378ae16 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala @@ -466,6 +466,8 @@ trait UntypedTreeInfo extends TreeInfo[Untyped] { self: Trees.Instance[Untyped] */ private def defKind(tree: Tree)(using Context): FlagSet = unsplice(tree) match { case EmptyTree | _: Import => NoInitsInterface + case tree: TypeDef if ctx.settings.YcompileScala2Library.value => + if (tree.isClassDef) EmptyFlags else NoInitsInterface case tree: TypeDef => if (tree.isClassDef) NoInits else NoInitsInterface case tree: DefDef => if tree.unforcedRhs == EmptyTree @@ -477,6 +479,8 @@ trait UntypedTreeInfo extends TreeInfo[Untyped] { self: Trees.Instance[Untyped] NoInitsInterface else if tree.mods.is(Given) && tree.paramss.isEmpty then EmptyFlags // might become a lazy val: TODO: check whether we need to suppress NoInits once we have new lazy val impl + else if ctx.settings.YcompileScala2Library.value then + EmptyFlags else NoInits case tree: ValDef => if (tree.unforcedRhs == EmptyTree) NoInitsInterface else EmptyFlags diff --git a/project/Scala2LibraryBootstrappedMiMaFilters.scala b/project/Scala2LibraryBootstrappedMiMaFilters.scala index 102a2a50e9d4..aac1afe7ae86 100644 --- a/project/Scala2LibraryBootstrappedMiMaFilters.scala +++ b/project/Scala2LibraryBootstrappedMiMaFilters.scala @@ -15,9 +15,6 @@ object Scala2LibraryBootstrappedMiMaFilters { ProblemFilters.exclude[FinalClassProblem]("scala.language$experimental$"), ProblemFilters.exclude[FinalClassProblem]("scala.languageFeature$*$"), - // trait $init$ - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.*.$init$"), - // Value class extension methods ProblemFilters.exclude[DirectMissingMethodProblem]("scala.*$extension"),