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
When enabled, all top-level definitions are annotated as `@experimental`.
This implies that all experimental language features and definitions can
be used in this project. This flags also allows the use of `ResearchPlugin`.
Note that this does not change the strong guarantees on stability of
non-experimental code. The experimental features can only be used in a
experimental scope (transitively).
Copy file name to clipboardExpand all lines: compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
+1
Original file line number
Diff line number
Diff line change
@@ -119,6 +119,7 @@ trait CommonScalaSettings:
119
119
valexplainTypes:Setting[Boolean] =BooleanSetting("-explain-types", "Explain type errors in more detail (deprecated, use -explain instead).", aliases =List("--explain-types", "-explaintypes"))
120
120
valunchecked:Setting[Boolean] =BooleanSetting("-unchecked", "Enable additional warnings where generated code depends on assumptions.", initialValue =true, aliases =List("--unchecked"))
121
121
vallanguage:Setting[List[String]] =MultiStringSetting("-language", "feature", "Enable one or more language features.", aliases =List("--language"))
122
+
valexperimental:Setting[Boolean] =BooleanSetting("-experimental", "Annotate all top-level definitions with @experimental. This enables the use of experimental features anywhere in the project.")
122
123
123
124
/* Coverage settings */
124
125
valcoverageOutputDir=PathSetting("-coverage-out", "Destination for coverage classfiles and instrumentation data.", "", aliases =List("--coverage-out"))
Copy file name to clipboardExpand all lines: docs/_docs/reference/experimental/overview.md
+4
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,10 @@ They are enabled by importing the feature or using the `-language` compiler flag
21
21
In general, experimental language features can be imported in an experimental scope (see [experimental definitions](../other-new-features/experimental-defs.md)).
22
22
They can be imported at the top-level if all top-level definitions are `@experimental`.
23
23
24
+
### `-experimental` compiler flag
25
+
26
+
This flag will make all top-level definitions have the `@experimental` annotation. This effectively enables the use of any experimental language feature in the project.
27
+
24
28
## Experimental language features supported by special compiler options
25
29
26
30
Some experimental language features that are still in research and development can be enabled with special compiler options. These include
Copy file name to clipboardExpand all lines: docs/_docs/reference/other-new-features/experimental-defs.md
+4
Original file line number
Diff line number
Diff line change
@@ -309,3 +309,7 @@ class MyExperimentalTests {
309
309
```
310
310
311
311
</details>
312
+
313
+
## `-experimental` compiler flag
314
+
315
+
This flag will make all top-level definitions have the `@experimental` annotation. This effectively enables the use of any experimental definition or language feature in the project.
0 commit comments