You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_docs/reference/other-new-features/experimental-defs.md
+2
Original file line number
Diff line number
Diff line change
@@ -268,6 +268,8 @@ Experimental definitions can only be referenced in an experimental scope. Experi
268
268
6. Any code compiled using a [_Nightly_](https://search.maven.org/artifact/org.scala-lang/scala3-compiler_3) or _Snapshot_ version of the compiler is considered to be in an experimental scope.
269
269
Can use the `-Yno-experimental` compiler flag to disable it and run as a proper release.
270
270
271
+
7. An experimental language feature is imported in at the package level. All top-level definitions will be marked as `@experimental`.
272
+
271
273
In any other situation, a reference to an experimental definition will cause a compilation error.
Copy file name to clipboardExpand all lines: tests/neg-macros/i18677-a.check
+2-2
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,10 @@
7
7
|The tree does not conform to the compiler's tree invariants.
8
8
|
9
9
|Macro was:
10
-
|@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-a/Test_2.scala") @scala.annotation.experimental("Added by -experimental") @extendFoo class AFoo()
10
+
|@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-a/Test_2.scala") @scala.annotation.experimental("Added by -experimental or -language:experimental.*") @extendFoo class AFoo()
11
11
|
12
12
|The macro returned:
13
-
|@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-a/Test_2.scala") @scala.annotation.experimental("Added by -experimental") @extendFoo class AFoo() extends Foo
13
+
|@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-a/Test_2.scala") @scala.annotation.experimental("Added by -experimental or -language:experimental.*") @extendFoo class AFoo() extends Foo
14
14
|
15
15
|Error:
16
16
|assertion failed: Parents of class symbol differs from the parents in the tree for class AFoo
Copy file name to clipboardExpand all lines: tests/neg-macros/i18677-b.check
+2-2
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,10 @@
7
7
|The tree does not conform to the compiler's tree invariants.
8
8
|
9
9
|Macro was:
10
-
|@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-b/Test_2.scala") @scala.annotation.experimental("Added by -experimental") @extendFoo class AFoo()
10
+
|@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-b/Test_2.scala") @scala.annotation.experimental("Added by -experimental or -language:experimental.*") @extendFoo class AFoo()
11
11
|
12
12
|The macro returned:
13
-
|@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-b/Test_2.scala") @scala.annotation.experimental("Added by -experimental") @extendFoo class AFoo() extends Foo
13
+
|@scala.annotation.internal.SourceFile("tests/neg-macros/i18677-b/Test_2.scala") @scala.annotation.experimental("Added by -experimental or -language:experimental.*") @extendFoo class AFoo() extends Foo
14
14
|
15
15
|Error:
16
16
|assertion failed: Parents of class symbol differs from the parents in the tree for class AFoo
0 commit comments