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 @@ -1141,6 +1141,7 @@ object Build {
1141
1141
file(s " ${baseDirectory.value}/src/scala/annotation/init.scala " ),
1142
1142
file(s " ${baseDirectory.value}/src/scala/annotation/unroll.scala " ),
1143
1143
file(s " ${baseDirectory.value}/src/scala/annotation/targetName.scala " ),
1144
+ file(s " ${baseDirectory.value}/src/scala/annotation/nullTrackable.scala " ),
1144
1145
file(s " ${baseDirectory.value}/src/scala/deriving/Mirror.scala " ),
1145
1146
file(s " ${baseDirectory.value}/src/scala/compiletime/package.scala " ),
1146
1147
file(s " ${baseDirectory.value}/src/scala/quoted/Type.scala " ),
@@ -1278,6 +1279,7 @@ object Build {
1278
1279
file(s " ${baseDirectory.value}/src/scala/annotation/init.scala " ),
1279
1280
file(s " ${baseDirectory.value}/src/scala/annotation/unroll.scala " ),
1280
1281
file(s " ${baseDirectory.value}/src/scala/annotation/targetName.scala " ),
1282
+ file(s " ${baseDirectory.value}/src/scala/annotation/nullTrackable.scala " ),
1281
1283
file(s " ${baseDirectory.value}/src/scala/deriving/Mirror.scala " ),
1282
1284
file(s " ${baseDirectory.value}/src/scala/compiletime/package.scala " ),
1283
1285
file(s " ${baseDirectory.value}/src/scala/quoted/Type.scala " ),
You can’t perform that action at this time.
0 commit comments