From 5664943c0c47eff4e3b4d0e3719cf66dbaeb50b0 Mon Sep 17 00:00:00 2001 From: Kacper Korban Date: Wed, 24 Jul 2024 19:46:35 +0200 Subject: [PATCH] fix: do not mark definitions from empty packages as experimental --- compiler/src/dotty/tools/dotc/typer/Checking.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index 1f82b9ddc084..fd867b4468e9 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -835,8 +835,9 @@ object Checking { if ctx.owner.is(Package) || ctx.owner.name.startsWith(str.REPL_SESSION_LINE) then def markTopLevelDefsAsExperimental(why: String): Unit = - for sym <- nonExperimentalTopLevelDefs(ctx.owner) do - sym.addAnnotation(ExperimentalAnnotation(s"Added by $why", sym.span)) + if !ctx.owner.isEmptyPackage then + for sym <- nonExperimentalTopLevelDefs(ctx.owner) do + sym.addAnnotation(ExperimentalAnnotation(s"Added by $why", sym.span)) unitExperimentalLanguageImports match case imp :: _ => markTopLevelDefsAsExperimental(i"top level $imp")