Skip to content

Commit 437d02a

Browse files
authored
Merge pull request #11016 from michelou/scala3-docs
[docs/reference] more fixes in Markdown files
2 parents 8effbc4 + f72855e commit 437d02a

24 files changed

+141
-99
lines changed

docs/docs/reference/changed-features/eta-expansion-spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def m(x: Int, y: String) = ???
1818
val f = m // becomes: val f = (x: Int, y: String) => m(x, y)
1919
```
2020

21-
In Scala 2, a method reference `m` was converted to a function value only if the expected type was a function type, which means the conversion in the example above would not have been triggered, because `val f` does not have a type ascription. To still get eta-expansion, a shortcut `m _` would force the conversion.
21+
In Scala 2, a method reference `m` is converted to a function value only if the expected type is a function type, which means the conversion in the example above would not have been triggered, because `val f` does not have a type ascription. To still get eta-expansion, a shortcut `m _` would force the conversion.
2222

2323
For methods with one or more parameters like in the example above, this restriction has now been dropped. The syntax `m _` is no longer needed and will be deprecated in the future.
2424

docs/docs/reference/changed-features/implicit-conversions-spec.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ Scala 3.
8787

8888
## Motivation for the changes
8989

90-
The introduction of `Conversion` in Scala 3 and the decision to
91-
restrict implicit values of this type to be considered as potential
92-
views comes from the desire to remove surprising behavior from the
93-
language:
90+
The introduction of [`scala.Conversion`](https://github.com/lampepfl/dotty/blob/master/library/src/scala/Conversion.scala)
91+
in Scala 3 and the decision to restrict implicit values of this type to be
92+
considered as potential views comes from the desire to remove surprising
93+
behavior from the language:
9494

9595
```scala
9696
implicit val m: Map[Int, String] = Map(1 -> "abc")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: "Rules for Operators"
66
The rules for infix operators have changed in some parts:
77

88
First, an alphanumeric method can be used as an infix operator only if its definition carries an `infix` modifier. Second, it is recommended (but not enforced) to
9-
augment definitions of symbolic operators with `@targetName` annotations. Finally,
9+
augment definitions of symbolic operators with [`@targetName` annotations](../other-new-features/targetName.md). Finally,
1010
a syntax change allows infix operators to be written on the left in a multi-line expression.
1111

1212
## The `infix` Modifier

docs/docs/reference/changed-features/structural-types-spec.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ RefineStat ::= ‘val’ VarDcl | ‘def’ DefDcl | ‘type’ {nl} TypeDcl
1414

1515
## Implementation of structural types
1616

17-
The standard library defines a universal marker trait `Selectable` in the package `scala`:
17+
The standard library defines a universal marker trait
18+
[`scala.Selectable`](https://github.com/lampepfl/dotty/blob/master/library/src/scala/Selectable.scala):
1819

1920
```scala
2021
trait Selectable extends Any
@@ -78,7 +79,8 @@ and `Rs` are structural refinement declarations, and given `v.a` of type `U`, we
7879
type, an error is emitted.
7980

8081
Note that `v`'s static type does not necessarily have to conform to `Selectable`, nor does it need to have `selectDynamic` and `applyDynamic` as members. It suffices that there is an implicit
81-
conversion that can turn `v` into a `Selectable`, and the selection methods could also be available as extension methods.
82+
conversion that can turn `v` into a `Selectable`, and the selection methods could also be available as
83+
[extension methods](../contextual/extension-methods.md).
8284

8385
## Limitations of structural types
8486

docs/docs/reference/contextual/context-functions-spec.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ Context function types associate to the right, e.g.
2020
Context function types are shorthands for class types that define `apply`
2121
methods with context parameters. Specifically, the `N`-ary function type
2222
`T1, ..., TN => R` is a shorthand for the class type
23-
`ContextFunctionN[T1 , ... , TN, R]`. Such class types are assumed to have the following definitions, for any value of `N >= 1`:
23+
`ContextFunctionN[T1, ..., TN, R]`. Such class types are assumed to have the following definitions, for any value of `N >= 1`:
2424

2525
```scala
2626
package scala
27-
trait ContextFunctionN[-T1 , ... , -TN, +R]:
28-
def apply(using x1: T1 , ... , xN: TN): R
27+
trait ContextFunctionN[-T1, ..., -TN, +R]:
28+
def apply(using x1: T1, ..., xN: TN): R
2929
```
3030

3131
Context function types erase to normal function types, so these classes are

docs/docs/reference/contextual/extension-methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ the right-associative operator `+:` to an extension method. This is analogous
6060
to the implementation of right binding operators as normal methods. The Scala
6161
compiler preprocesses an infix operation `x +: xs` to `xs.+:(x)`, so the extension
6262
method ends up being applied to the sequence as first argument (in other words, the
63-
two swaps cancel each other out). See [here for details](./right-associative-extension-methods.html).
63+
two swaps cancel each other out). See [here for details](./right-associative-extension-methods.md).
6464

6565
### Generic Extensions
6666

docs/docs/reference/contextual/implicit-by-name-parameters.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/docs/reference/contextual/import-delegate.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/docs/reference/contextual/import-implied.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/docs/reference/contextual/inferable-by-name-parameters.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)