Skip to content

Commit 3d85473

Browse files
Merge pull request #11389 from ShapelessCat/fix-links-in-docs
Fix links in docs
2 parents 73d34fd + 98164f8 commit 3d85473

File tree

5 files changed

+20
-21
lines changed

5 files changed

+20
-21
lines changed

docs/docs/internals/syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ semi ::= ‘;’ | nl {nl}
8888

8989
## Optional Braces
9090

91-
The lexical analyzer also inserts `indent` and `outdent` tokens that represent regions of indented code [at certain points](../reference/other-new-features-indentation.html)
91+
The lexical analyzer also inserts `indent` and `outdent` tokens that represent regions of indented code [at certain points](../reference/other-new-features/indentation.md)
9292

9393
In the context-free productions below we use the notation `<<< ts >>>`
9494
to indicate a token sequence `ts` that is either enclosed in a pair of braces `{ ts }` or that constitutes an indented region `indent ts outdent`. Analogously, the

docs/docs/reference/metaprogramming/macros-spec.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Separator * ::= '
9090
The two environment combinators are both associative with left and
9191
right identity `()`.
9292

93-
### Operational semantics:
93+
### Operational semantics
9494

9595
We define a small step reduction relation `-->` with the following rules:
9696
```
@@ -111,6 +111,7 @@ splice evaluation context `e_s` are defined syntactically as follows:
111111
Eval context e ::= [ ] | e t | v e | 'e_s[${e}]
112112
Splice context e_s ::= [ ] | (x: T) => e_s | e_s t | u e_s
113113
```
114+
114115
### Typing rules
115116

116117
Typing judgments are of the form `Es |- t: T`. There are two

docs/docs/reference/new-types/dependent-function-types-spec.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ Initial implementation in [PR #3464](https://github.com/lampepfl/dotty/pull/3464
77

88
## Syntax
99

10-
```
10+
```ebnf
1111
FunArgTypes ::= InfixType
1212
| ‘(’ [ FunArgType {',' FunArgType } ] ‘)’
1313
| ‘(’ TypedFunParam {',' TypedFunParam } ‘)’
1414
TypedFunParam ::= id ‘:’ Type
1515
```
1616

1717
Dependent function types associate to the right, e.g.
18-
`(s: S) (t: T) U` is the same as `(s: S) ((t: T) U)`.
18+
`(s: S) => (t: T) => U` is the same as `(s: S) => ((t: T) => U)`.
1919

2020
## Implementation
2121

@@ -25,7 +25,7 @@ refinement types of `scala.FunctionN`. A dependent function type
2525
`(x1: K1, ..., xN: KN) => R` of arity `N` translates to:
2626

2727
```scala
28-
FunctionN[K1, ..., Kn, R'] with
28+
FunctionN[K1, ..., Kn, R']:
2929
def apply(x1: K1, ..., xN: KN): R
3030
```
3131

docs/docs/reference/other-new-features/transparent-traits.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ val x = Set(if condition then Val else Var)
1919

2020
Here, the inferred type of `x` is `Set[Kind & Product & Serializable]` whereas one would have hoped it to be `Set[Kind]`. The reasoning for this particular type to be inferred is as follows:
2121

22-
- The type of the conditional above is the [union type](new-types/union-types.md) `Val | Var`.
23-
- A union type is widened in type inference to the least supertype that is
24-
not a union type. In the example, this type is `Kind & Product & Serializable` since all three traits are traits of both `Val` and `Var`.
25-
So that type becomes the inferred element type of the set.
22+
- The type of the conditional above is the [union type](../new-types/union-types.md) `Val | Var`.
23+
- A union type is widened in type inference to the least supertype that is not a union type.
24+
In the example, this type is `Kind & Product & Serializable` since all three traits are traits of both `Val` and `Var`.
25+
So that type becomes the inferred element type of the set.
2626

2727
Scala 3 allows one to mark a mixin trait as `transparent`, which means that it can be suppressed in type inference. Here's an example that follows the lines of the code above, but now with a new transparent trait `S` instead of `Product`:
2828

@@ -46,9 +46,8 @@ by adding a [`@transparentTrait` annotation](https://dotty.epfl.ch/api/scala/ann
4646
Typically, transparent traits are traits
4747
that influence the implementation of inheriting classes and traits that are not usually used as types by themselves. Two examples from the standard collection library are:
4848

49-
- `IterableOps`, which provides method implementations for an `Iterable`
50-
- `StrictOptimizedSeqOps`, which optimises some of these implementations for
51-
sequences with efficient indexing.
49+
- `IterableOps`, which provides method implementations for an `Iterable`.
50+
- `StrictOptimizedSeqOps`, which optimises some of these implementations for sequences with efficient indexing.
5251

5352
Generally, any trait that is extended recursively is a good candidate to be
5453
declared transparent.
@@ -59,13 +58,12 @@ Transparent traits can be given as explicit types as usual. But they are often e
5958

6059
The precise rules are as follows:
6160

62-
- When inferring a type of a type variable, or the type of a val, or the return type of a def,
63-
- where that type is not higher-kinded,
64-
- and where `B` is its known upper bound or `Any` if none exists:
65-
- If the type inferred so far is of the form `T1 & ... & Tn` where
66-
`n >= 1`, replace the maximal number of transparent `Ti`s by `Any`, while ensuring that
67-
the resulting type is still a subtype of the bound `B`.
68-
- However, do not perform this widening if all transparent traits `Ti` can get replaced in that way.
61+
- When inferring a type of a type variable, or the type of a val, or the return type of a def,
62+
- where that type is not higher-kinded,
63+
- and where `B` is its known upper bound or `Any` if none exists:
64+
- If the type inferred so far is of the form `T1 & ... & Tn` where
65+
`n >= 1`, replace the maximal number of transparent `Ti`s by `Any`, while ensuring that
66+
the resulting type is still a subtype of the bound `B`.
67+
- However, do not perform this widening if all transparent traits `Ti` can get replaced in that way.
6968

7069
The last clause ensures that a single transparent trait instance such as `Product` is not widened to `Any`. Transparent trait instances are only dropped when they appear in conjunction with some other type.
71-

docs/docs/reference/syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ semi ::= ‘;’ | nl {nl}
8787

8888
## Optional Braces
8989

90-
The lexical analyzer also inserts `indent` and `outdent` tokens that represent regions of indented code [at certain points](../other-new-features/indentation.md).
90+
The lexical analyzer also inserts `indent` and `outdent` tokens that represent regions of indented code [at certain points](./other-new-features/indentation.md).
9191

9292
In the context-free productions below we use the notation `<<< ts >>>`
9393
to indicate a token sequence `ts` that is either enclosed in a pair of braces `{ ts }` or that constitutes an indented region `indent ts outdent`. Analogously, the

0 commit comments

Comments
 (0)