1
1
package scala .runtime .stdLibPatches
2
2
3
+ import scala .annotation .compileTimeOnly
4
+
3
5
/** Scala 3 additions and replacements to the `scala.language` object.
4
6
*/
5
7
object language :
@@ -29,18 +31,21 @@ object language:
29
31
*
30
32
* @see [[https://dotty.epfl.ch/docs/reference/other-new-features/named-typeargs ]]
31
33
*/
34
+ @ compileTimeOnly(" `namedTypeArguments` can only be used at compile time in import statements" )
32
35
object namedTypeArguments
33
36
34
37
/** Experimental support for generic number literals.
35
38
*
36
39
* @see [[https://dotty.epfl.ch/docs/reference/changed-features/numeric-literals ]]
37
40
*/
41
+ @ compileTimeOnly(" `genericNumberLiterals` can only be used at compile time in import statements" )
38
42
object genericNumberLiterals
39
43
40
44
/** Experimental support for `erased` modifier
41
45
*
42
46
* @see [[https://dotty.epfl.ch/docs/reference/experimental/erased-defs ]]
43
47
*/
48
+ @ compileTimeOnly(" `erasedDefinitions` can only be used at compile time in import statements" )
44
49
object erasedDefinitions
45
50
46
51
end experimental
@@ -56,6 +61,7 @@ object language:
56
61
* symbol literals are still supported with a language import, but new software
57
62
* should not use them.
58
63
*/
64
+ @ compileTimeOnly(" `symbolLiterals` can only be used at compile time in import statements" )
59
65
object symbolLiterals
60
66
end deprecated
61
67
@@ -69,6 +75,7 @@ object language:
69
75
* '''Why allow it?''' Not allowing auto-tupling is difficult to reconcile with
70
76
* operators accepting tuples.
71
77
*/
78
+ @ compileTimeOnly(" `noAutoTupling` can only be used at compile time in import statements" )
72
79
object noAutoTupling
73
80
74
81
/** Where imported, loose equality using eqAny is disabled.
@@ -78,6 +85,7 @@ object language:
78
85
*
79
86
* @see [[https://dotty.epfl.ch/docs/reference/contextual/multiversal-equality ]]
80
87
*/
88
+ @ compileTimeOnly(" `strictEquality` can only be used at compile time in import statements" )
81
89
object strictEquality
82
90
83
91
/** Where imported, ad hoc extensions of non-open classes in other
@@ -96,29 +104,35 @@ object language:
96
104
* such extensions should be limited in scope and clearly documented.
97
105
* That's why the language import is required for them.
98
106
*/
107
+ @ compileTimeOnly(" `adhocExtensions` can only be used at compile time in import statements" )
99
108
object adhocExtensions
100
109
101
110
/** Unsafe Nulls fot Explicit Nulls
102
111
* Inside the "unsafe" scope, `Null` is considered as a subtype of all reference types.
103
112
*
104
113
* @see [[http://dotty.epfl.ch/docs/reference/other-new-features/explicit-nulls.html ]]
105
114
*/
115
+ @ compileTimeOnly(" `unsafeNulls` can only be used at compile time in import statements" )
106
116
object unsafeNulls
107
117
118
+ @ compileTimeOnly(" `future` can only be used at compile time in import statements" )
108
119
object future
109
120
121
+ @ compileTimeOnly(" `future-migration` can only be used at compile time in import statements" )
110
122
object `future-migration`
111
123
112
124
/** Set source version to 3.0-migration.
113
125
*
114
126
* @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode ]]
115
127
*/
128
+ @ compileTimeOnly(" `3.0-migration` can only be used at compile time in import statements" )
116
129
object `3.0-migration`
117
130
118
131
/** Set source version to 3.0.
119
132
*
120
133
* @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode ]]
121
134
*/
135
+ @ compileTimeOnly(" `3.0` can only be used at compile time in import statements" )
122
136
object `3.0`
123
137
124
138
/* This can be added when we go to 3.1
0 commit comments