Skip to content

Commit e43d09f

Browse files
committed
Fix links in docs
1 parent ae7bbd8 commit e43d09f

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
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/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)