Skip to content

Commit ebd2c8f

Browse files
committed
doc(type-args): mention order and fix 1st sentence
1 parent 5231493 commit ebd2c8f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/docs/reference/other-new-features/named-typeargs.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "Named Type Arguments"
55

66
**Note:** This feature is implemented in Dotty, but is not expected to be part of Scala 3.0.
77

8-
Type arguments of methods can now be named, as well as by position. Example:
8+
Type arguments of methods can now be specified by name as well as by position. Example:
99

1010
``` scala
1111
def construct[Elem, Coll[_]](xs: Elem*): Coll[Elem] = ???
@@ -15,8 +15,10 @@ val xs2 = construct[Coll = List](1, 2, 3)
1515
```
1616

1717
Similar to a named value argument `(x = e)`, a named type argument
18-
`[X = T]` instantiates the type parameter `X` to the type `T`. Type
19-
arguments must be all named or un-named, mixtures of named and
18+
`[X = T]` instantiates the type parameter `X` to the type `T`.
19+
Named type arguments do not have to be in order (see `xs1` above) and
20+
unspecified arguments are inferred by the compiler (see `xs2` above).
21+
Type arguments must be all named or un-named, mixtures of named and
2022
positional type arguments are not supported.
2123

2224
## Motivation

0 commit comments

Comments
 (0)