Skip to content

Commit

Permalink
fix: do not mark definitions from empty pagkages as experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperFKorban committed Sep 20, 2024
1 parent 25ad99c commit 0d0a8e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/src/dotty/tools/dotc/typer/Checking.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 0d0a8e7

Please sign in to comment.