Skip to content

Commit 604eb64

Browse files
committed
Clarify docs
1 parent ac20ba5 commit 604eb64

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/docs/reference/dropped-features/wildcard-init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The syntax
77
```scala
88
var x: A = _
99
```
10-
that was used to indicate an uninitialized field has been dropped.
10+
that was used to indicate an uninitialized field, has been dropped.
1111
At its place there is a special value `uninitialized` in the `scala.compiletime` package. To get an uninitialized field, you now write
1212
```scala
1313
import scala.compiletime.uninitialized

library/src/scala/compiletime/package.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ package object compiletime {
2020
*
2121
* var x: T = uninitialized
2222
*
23-
* This signifies that the field is not initialized on its own (On the JVM
24-
* it is still bulk-initialized to a zero bitfield).
23+
* This signifies that the field is not initialized on its own. It is still initialized
24+
* as part of the bulk initialization of the object it belongs to, which assigns zero
25+
* values such as `null`, `0`, `0.0`, `false` to all object fields.
2526
*/
2627
erased def uninitialized[T]: T = ???
2728

0 commit comments

Comments
 (0)