Skip to content

Commit 7f4b231

Browse files
committed
Change NamedTuple.FieldsOf to NamedTuple.From
1 parent 836d7b0 commit 7f4b231

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

content/named-tuples.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,19 @@ The translation of named tuples to instances of `NamedTuple` is fixed by the spe
146146
- All tuple operations also work with named tuples "out of the box".
147147
- Macro libraries can rely on this expansion.
148148

149-
### The FieldsOf Type
149+
### The NamedTuple.From Type
150150

151151
The `NamedTuple` object contains a type definition
152152
```scala
153-
type FieldsOf[T] <: AnyNamedTuple
153+
type From[T] <: AnyNamedTuple
154154
```
155-
`FieldsOf` is treated specially by the compiler. When `FieldsOf` is applied to
155+
`From` is treated specially by the compiler. When `NamedTuple.From` is applied to
156156
an argument type that is an instance of a case class, the type expands to the named
157157
tuple consisting of all the fields of that case class. Here, fields means: elements of the first parameter section. For instance, assuming
158158
```scala
159159
case class City(zip: Int, name: String, population: Int)
160160
```
161-
then `FieldsOf[City]` is the named tuple
161+
then `NamedTuple.From[City]` is the named tuple
162162
```scala
163163
(zip: Int, name: String, population: Int)
164164
```

0 commit comments

Comments
 (0)