File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
library/src/scala/annotation Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
package scala .annotation
2
2
3
- final class nullTrackable extends StaticAnnotation
3
+ /** An annotation that can be used to mark a mutable field as trackable for nullability.
4
+ * With explicit nulls, a normal mutable field can be tracked for nullability by flow typing,
5
+ * since it can be updated to a null value at the same time.
6
+ * This annotation will force the compiler to track the field for nullability, as long as the
7
+ * prefix is a stable path.
8
+ * See `tests/explicit-nulls/pos/force-track-var-fields.scala` for an example.
9
+ */
10
+ final class nullTrackable extends StaticAnnotation
Original file line number Diff line number Diff line change @@ -1191,6 +1191,7 @@ object Build {
1191
1191
file(s " ${baseDirectory.value}/src/scala/annotation/init.scala " ),
1192
1192
file(s " ${baseDirectory.value}/src/scala/annotation/unroll.scala " ),
1193
1193
file(s " ${baseDirectory.value}/src/scala/annotation/targetName.scala " ),
1194
+ file(s " ${baseDirectory.value}/src/scala/annotation/nullTrackable.scala " ),
1194
1195
file(s " ${baseDirectory.value}/src/scala/deriving/Mirror.scala " ),
1195
1196
file(s " ${baseDirectory.value}/src/scala/compiletime/package.scala " ),
1196
1197
file(s " ${baseDirectory.value}/src/scala/quoted/Type.scala " ),
@@ -1326,6 +1327,7 @@ object Build {
1326
1327
file(s " ${baseDirectory.value}/src/scala/annotation/init.scala " ),
1327
1328
file(s " ${baseDirectory.value}/src/scala/annotation/unroll.scala " ),
1328
1329
file(s " ${baseDirectory.value}/src/scala/annotation/targetName.scala " ),
1330
+ file(s " ${baseDirectory.value}/src/scala/annotation/nullTrackable.scala " ),
1329
1331
file(s " ${baseDirectory.value}/src/scala/deriving/Mirror.scala " ),
1330
1332
file(s " ${baseDirectory.value}/src/scala/compiletime/package.scala " ),
1331
1333
file(s " ${baseDirectory.value}/src/scala/quoted/Type.scala " ),
You can’t perform that action at this time.
0 commit comments