Skip to content

Commit 5664943

Browse files
committed
fix: do not mark definitions from empty packages as experimental
1 parent 25ad99c commit 5664943

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,9 @@ object Checking {
835835

836836
if ctx.owner.is(Package) || ctx.owner.name.startsWith(str.REPL_SESSION_LINE) then
837837
def markTopLevelDefsAsExperimental(why: String): Unit =
838-
for sym <- nonExperimentalTopLevelDefs(ctx.owner) do
839-
sym.addAnnotation(ExperimentalAnnotation(s"Added by $why", sym.span))
838+
if !ctx.owner.isEmptyPackage then
839+
for sym <- nonExperimentalTopLevelDefs(ctx.owner) do
840+
sym.addAnnotation(ExperimentalAnnotation(s"Added by $why", sym.span))
840841

841842
unitExperimentalLanguageImports match
842843
case imp :: _ => markTopLevelDefsAsExperimental(i"top level $imp")

0 commit comments

Comments
 (0)