Skip to content

Commit 60b8437

Browse files
Update wildcards.md (#19341)
The documentation gives incorrect Scala versions for the transitions.
2 parents e9d38aa + 074128b commit 60b8437

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/_docs/reference/changed-features/wildcards.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Wildcard Arguments in Types
44
nightlyOf: https://docs.scala-lang.org/scala3/reference/changed-features/wildcards.html
55
---
66

7-
The syntax of wildcard arguments in types has changed from `_` to `?`. Example:
7+
The syntax of wildcard arguments in types is changing from `_` to `?`. Example:
88
```scala
99
List[?]
1010
Map[? <: AnyRef, ? >: Null]
@@ -14,8 +14,8 @@ Map[? <: AnyRef, ? >: Null]
1414

1515
We would like to use the underscore syntax `_` to stand for an anonymous type parameter, aligning it with its meaning in
1616
value parameter lists. So, just as `f(_)` is a shorthand for the lambda `x => f(x)`, in the future `C[_]` will be a shorthand
17-
for the type lambda `[X] =>> C[X]`. This makes higher-kinded types easier to use. It also removes the wart that, used as a type
18-
parameter, `F[_]` means `F` is a type constructor whereas used as a type, `F[_]` means it is a wildcard (i.e. existential) type.
17+
for the type lambda `[X] =>> C[X]`. This will make higher-kinded types easier to use. It will also remove the wart that, used as a type
18+
parameter, `F[_]` means `F` is a type constructor, whereas used as a type, `F[_]` means it is a wildcard (i.e. existential) type.
1919
In the future, `F[_]` will mean the same thing, no matter where it is used.
2020

2121
We pick `?` as a replacement syntax for wildcard types, since it aligns with
@@ -28,11 +28,11 @@ compiler plugin still uses the reverse convention, with `?` meaning parameter pl
2828

2929
A step-by-step migration is made possible with the following measures:
3030

31-
1. In Scala 3.0, both `_` and `?` are legal names for wildcards.
32-
2. In Scala 3.1, `_` is deprecated in favor of `?` as a name for a wildcard. A `-rewrite` option is
31+
1. In earlier versions of Scala 3, both `_` and `?` are legal names for wildcards.
32+
2. In Scala 3.4, `_` will be deprecated in favor of `?` as a name for wildcards. A `-rewrite` option is
3333
available to rewrite one to the other.
34-
3. In Scala 3.2, the meaning of `_` changes from wildcard to placeholder for type parameter.
35-
4. The Scala 3.1 behavior is already available today under the `-source future` setting.
34+
3. At some later point in the future, the meaning of `_` will change from wildcard to placeholder for type parameters.
35+
4. Some deprecation warnings are already available under the `-source future` setting.
3636

3737
To smooth the transition for codebases that use kind-projector, we adopt the following measures under the command line
3838
option `-Ykind-projector`:
@@ -42,7 +42,7 @@ option `-Ykind-projector`:
4242
available to rewrite one to the other.
4343
3. In Scala 3.3, `*` is removed again, and all type parameter placeholders will be expressed with `_`.
4444

45-
These rules make it possible to cross build between Scala 2 using the kind projector plugin and Scala 3.0 - 3.2 using the compiler option `-Ykind-projector`.
45+
These rules make it possible to cross-build between Scala 2 using the kind projector plugin and Scala 3.0 - 3.2 using the compiler option `-Ykind-projector`.
4646

4747
There is also a migration path for users that want a one-time transition to syntax with `_` as a type parameter placeholder.
4848
With option `-Ykind-projector:underscores` Scala 3 will regard `_` as a type parameter placeholder, leaving `?` as the only syntax for wildcards.

0 commit comments

Comments
 (0)