Skip to content

Commit 5a6878b

Browse files
committed
Update doc pages
1 parent 8f3f9af commit 5a6878b

File tree

8 files changed

+18
-15
lines changed

8 files changed

+18
-15
lines changed

docs/docs/reference/changed-features/operators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ The purpose of the `infix` modifier is to achieve consistency across a code base
9292
can be applied using infix syntax, i.e. `A op B`.
9393

9494
5. To smooth migration to Scala 3.0, alphanumeric operators will only be deprecated from Scala 3.1 onwards,
95-
or if the `-source 3.1` option is given in Dotty/Scala 3.
95+
or if the `-source future` option is given in Dotty/Scala 3.
9696

9797
## The `@targetName` Annotation
9898

docs/docs/reference/changed-features/pattern-bindings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ val xs: List[Any] = List(1, 2, 3)
1515
val (x: String) :: _ = xs // error: pattern's type String is more specialized
1616
// than the right-hand side expression's type Any
1717
```
18-
This code gives a compile-time warning in Scala 3.1 (and also in Scala 3.0 under the `-source 3.1` setting) whereas it will fail at runtime with a `ClassCastException` in Scala 2. In Scala 3.1, a pattern binding is only allowed if the pattern is _irrefutable_, that is, if the right-hand side's type conforms to the pattern's type. For instance, the following is OK:
18+
This code gives a compile-time warning in Scala 3.1 (and also in Scala 3.0 under the `-source future` setting) whereas it will fail at runtime with a `ClassCastException` in Scala 2. In Scala 3.1, a pattern binding is only allowed if the pattern is _irrefutable_, that is, if the right-hand side's type conforms to the pattern's type. For instance, the following is OK:
1919
```scala
2020
val pair = (1, true)
2121
val (x, y) = pair
@@ -56,4 +56,4 @@ Generator ::= [‘case’] Pattern1 ‘<-’ Expr
5656

5757
## Migration
5858

59-
The new syntax is supported in Scala 3.0. However, to enable smooth cross compilation between Scala 2 and Scala 3, the changed behavior and additional type checks are only enabled under the `-source 3.1` setting. They will be enabled by default in version 3.1 of the language.
59+
The new syntax is supported in Scala 3.0. However, to enable smooth cross compilation between Scala 2 and Scala 3, the changed behavior and additional type checks are only enabled under the `-source future` setting. They will be enabled by default in version 3.1 of the language.

docs/docs/reference/changed-features/vararg-splices.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ ParArgumentExprs ::= ‘(’ [‘using’] ExprsInParens ‘)’
3434
## Compatibility considerations
3535

3636
To enable cross compilation between Scala 2 and Scala 3, the compiler will
37-
accept both the old and the new syntax. Under the `-source 3.1` setting, an error
37+
accept both the old and the new syntax. Under the `-source future` setting, an error
3838
will be emitted when the old syntax is encountered. An automatic rewrite from old
39-
to new syntax is offered under `-source 3.1-migration`.
39+
to new syntax is offered under `-source future-migration`.
4040

4141

4242

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A step-by-step migration is made possible with the following measures:
3131
2. In Scala 3.1, `_` is deprecated in favor of `?` as a name for a wildcard. A `-rewrite` option is
3232
available to rewrite one to the other.
3333
3. In Scala 3.2, the meaning of `_` changes from wildcard to placeholder for type parameter.
34-
4. The Scala 3.1 behavior is already available today under the `-source 3.1` setting.
34+
4. The Scala 3.1 behavior is already available today under the `-source future` setting.
3535

3636
To smooth the transition for codebases that use kind-projector, we adopt the following measures under the command line
3737
option `-Ykind-projector`:

docs/docs/reference/contextual/context-bounds.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def g[T <: B : C](x: T): R = ...
3232
To ease migration, context bounds in Dotty map in Scala 3.0 to old-style implicit parameters
3333
for which arguments can be passed either with a `(using ...)` clause or with a normal application. From Scala 3.1 on, they will map to context parameters instead, as is described above.
3434

35-
If the source version is `3.1` and the `-migration` command-line option is set, any pairing of an evidence
35+
If the source version is `future` and the `-migration` command-line option is set, any pairing of an evidence
3636
context parameter stemming from a context bound with a normal argument will give a migration
3737
warning. The warning indicates that a `(using ...)` clause is needed instead. The rewrite can be
3838
done automatically under `-rewrite`.

docs/docs/reference/other-new-features/matchable.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ a type pattern `_: C` it is required that the selector type conforms
5353
to `Matchable`. If that's not the case a warning is issued. For instance when compiling the example at the start of this section we get:
5454

5555
```
56-
> sc ../new/test.scala -source 3.1
56+
> sc ../new/test.scala -source future
5757
-- Warning: ../new/test.scala:4:12 ---------------------------------------------
5858
4 | case a: Array[Int] => a(0) = 0
5959
| ^^^^^^^^^^
@@ -62,7 +62,7 @@ to `Matchable`. If that's not the case a warning is issued. For instance when co
6262
```
6363

6464
To allow migration from Scala 2 and cross-compiling
65-
between Scala 2 and 3 the warning is turned on only for `-source 3.1-migration` or higher.
65+
between Scala 2 and 3 the warning is turned on only for `-source future-migration` or higher.
6666

6767
`Matchable` is a universal trait with `Any` as its parent class. It is
6868
extended by both `AnyVal` and `AnyRef`. Since `Matchable` is a supertype of every concrete value or reference class it means that instances of such classes can be matched as before. However, match selectors of the following types will produce a warning:

docs/docs/reference/other-new-features/open-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ A class that is neither `abstract` nor `open` is similar to a `sealed` class: it
7676

7777
### Migration
7878

79-
`open` is a new modifier in Scala 3. To allow cross compilation between Scala 2.13 and Scala 3.0 without warnings, the feature warning for ad-hoc extensions is produced only under `-source 3.1`. It will be produced by default from Scala 3.1 on.
79+
`open` is a new modifier in Scala 3. To allow cross compilation between Scala 2.13 and Scala 3.0 without warnings, the feature warning for ad-hoc extensions is produced only under `-source future`. It will be produced by default from Scala 3.1 on.

docs/docs/usage/language-versions.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ title: "Language Versions"
55

66
The default Scala language version currently supported by the Dotty compiler is `3.0`. There are also other language versions that can be specified instead:
77

8-
- `3.1`: A preview of changes introduced in the next version after 3.0. Some Scala-2 specific idioms will be dropped in this version. The feature set supported by this version will be refined over time as we approach its release.
9-
108
- `3.0-migration`: Same as `3.0` but with a Scala 2 compatibility mode that helps moving Scala 2.13 sources over to Scala 3. In particular, it
119

1210
- flags some Scala 2 constructs that are disallowed in Scala 3 as migration warnings instead of hard errors,
1311
- changes some rules to be more lenient and backwards compatible with Scala 2.13
1412
- gives some additional warnings where the semantics has changed between Scala 2.13 and 3.0
1513
- in conjunction with `-rewrite`, offer code rewrites from Scala 2.13 to 3.0.
1614

17-
- `3.1-migration`: Same as `3.1` but with additional helpers to migrate from `3.0`. Similarly to the helpers available under `3.0-migration`, these include migration warnings and optional rewrites.
15+
- `future`: A preview of changes introduced in the next versions after 3.0. In the doc pages here we refer to the language version with these changes as `3.1`, but it might be that some of these changes will be rolled out in later `3.x` versions.
16+
17+
Some Scala-2 specific idioms will be dropped in this version. The feature set supported by this version will be refined over time as we approach its release.
18+
19+
- `future-migration`: Same as `future` but with additional helpers to migrate from `3.0`. Similarly to the helpers available under `3.0-migration`, these include migration warnings and optional rewrites.
1820

1921
There are two ways to specify a language version.
2022

@@ -23,9 +25,10 @@ There are two ways to specify a language version.
2325

2426
```scala
2527
package p
26-
import scala.language.`3.1`
28+
import scala.language.`future-migration`
2729

2830
class C { ... }
2931
```
3032

31-
Language imports supersede command-line settings in the compilation units where they are specified. Only one language import is allowed in a compilation unit, and it must come before any definitions in that unit.
33+
Language imports supersede command-line settings in the compilation units where they are specified. Only one language import specifying a source version is allowed in a compilation unit, and it must come before any definitions in that unit.
34+

0 commit comments

Comments
 (0)