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 {
962
962
new Checker ().traverse(sym.info)
963
963
964
964
private def checkExperimentalAnnots (sym : Symbol )(using Context ): Unit =
965
- if ! sym.isExperimental then
965
+ if ! sym.isInExperimentalScope then
966
966
for annot <- sym.annotations if annot.symbol.isExperimental do
967
967
Feature .checkExperimentalDef(annot.symbol, annot.tree)
968
968
Original file line number Diff line number Diff line change @@ -8,3 +8,15 @@ def test1: Unit = ()
8
8
@ experimental
9
9
@ myExperimentalAnnot
10
10
def 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