File tree 4 files changed +21
-0
lines changed
compiler/src/dotty/tools/dotc/config
library/src/scala/runtime/stdLibPatches
4 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ object Feature:
23
23
private val genericNumberLiterals = experimental(" genericNumberLiterals" )
24
24
val scala2macros = experimental(" macros" )
25
25
26
+ val mode = experimental(" mode" )
26
27
val dependent = experimental(" dependent" )
27
28
val erasedDefinitions = experimental(" erasedDefinitions" )
28
29
val symbolLiterals = deprecated(" symbolLiterals" )
@@ -37,6 +38,7 @@ object Feature:
37
38
// TODO compute this list
38
39
// TODO remove features that do not enable experimental mode
39
40
val experimentalAutoEnableFeatures : List [TermName ] = List (
41
+ mode,
40
42
namedTypeArguments,
41
43
genericNumberLiterals,
42
44
erasedDefinitions,
Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ object language:
20
20
*/
21
21
object experimental :
22
22
23
+ /** Enable use of experimental APIs by making the current scope an experimental one.
24
+ *
25
+ * @see [[https://dotty.epfl.ch/docs/reference/other-new-features/experimental-defs ]]
26
+ */
27
+ @ compileTimeOnly(" `mode` can only be used at compile time in import statements" )
28
+ object mode
29
+
30
+
23
31
/* Experimental support for richer dependent types (disabled for now)
24
32
* One can still run the compiler with support for parsing singleton applications
25
33
* using command line option `-language:experimental.dependent`.
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ object MiMaFilters {
8
8
val ForwardsBreakingChanges : Map [String , Seq [ProblemFilter ]] = Map (
9
9
// Additions that require a new minor version of the library
10
10
Build .previousDottyVersion -> Seq (
11
+ ProblemFilters .exclude[MissingFieldProblem ](" scala.runtime.stdLibPatches.language#experimental.mode" ),
12
+ ProblemFilters .exclude[MissingClassProblem ](" scala.runtime.stdLibPatches.language$experimental$mode$" ),
11
13
),
12
14
13
15
// Additions since last LTS
Original file line number Diff line number Diff line change
1
+ //> using option -Yno-experimental
2
+
3
+ import scala .language .experimental .mode
4
+ import scala .annotation .experimental
5
+
6
+ @ experimental
7
+ def foo = 1
8
+
9
+ def bar = foo // made `@experimental` by `scala.language.experimental.mode`
You can’t perform that action at this time.
0 commit comments