Skip to content

Commit c950006

Browse files
committed
Avoid reporting extra errors on enums
1 parent c8eb6cd commit c950006

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ object RefChecks {
989989
checker.traverse(tpe)
990990

991991
private def checkExperimentalAnnots(sym: Symbol)(using Context): Unit =
992-
for annot <- sym.annotations if annot.symbol.isExperimental do
992+
for annot <- sym.annotations if annot.symbol.isExperimental && annot.tree.span.exists do
993993
Feature.checkExperimentalDef(annot.symbol, annot.tree)
994994

995995
/** If @migration is present (indicating that the symbol has changed semantics between versions),

tests/neg-custom-args/no-experimental/experimentalEnum.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// nopos-error // nopos-error // nopos-error // FIXME redundant due to enum
21
import scala.annotation.experimental
32

43
@experimental // error

0 commit comments

Comments
 (0)