Skip to content

Commit 87cb1d8

Browse files
authored
Merge pull request #9574 from xuwei-k/strict-option-in-docs
Replace "-strict" with "-source 3.1" in docs
2 parents 4dbe0b7 + a59bd12 commit 87cb1d8

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

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

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

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

138138
## Syntax Change
139139

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 error in Scala 3.1 (and also in Scala 3.0 under the `-strict` 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 error 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:
1919
```scala
2020
val pair = (1, true)
2121
val (x, y) = pair
@@ -58,4 +58,4 @@ Generator ::= [‘case’] Pattern1 ‘<-’ Expr
5858

5959
## Migration
6060

61-
The new syntax is supported in Dotty and 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 `-strict` setting. They will be enabled by default in version 3.1 of the language.
61+
The new syntax is supported in Dotty and 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.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The change to the grammar is:
3737
## Compatibility considerations
3838

3939
To enable smooth cross compilation between Scala 2 and Scala 3, Dotty will
40-
accept both the old and the new syntax. Under the `-strict` setting, an error
40+
accept both the old and the new syntax. Under the `-source 3.1` setting, an error
4141
will be emitted when the old syntax is encountered. They will be enabled by
4242
default in version 3.1 of the language.
4343

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

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

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

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 `-strict`. 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 3.1`. It will be produced by default from Scala 3.1 on.

0 commit comments

Comments
 (0)