File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
compiler/src/dotty/tools/dotc/typer
tests/neg-custom-args/no-experimental Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -962,7 +962,7 @@ object RefChecks {
962962 new Checker ().traverse(sym.info)
963963
964964 private def checkExperimentalAnnots (sym : Symbol )(using Context ): Unit =
965- if ! sym.isExperimental then
965+ if ! sym.isInExperimentalScope then
966966 for annot <- sym.annotations if annot.symbol.isExperimental do
967967 Feature .checkExperimentalDef(annot.symbol, annot.tree)
968968
Original file line number Diff line number Diff line change @@ -8,3 +8,15 @@ def test1: Unit = ()
88@ experimental
99@ myExperimentalAnnot
1010def test2 : Unit = ()
11+
12+ @ experimental
13+ class Foo {
14+ @ myExperimentalAnnot
15+ def test3 : Unit = ()
16+
17+ def test4 : Unit = {
18+ @ myExperimentalAnnot
19+ val f : Unit = ()
20+ f
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments