Skip to content

Commit 211973c

Browse files
committed
doc(intersection-overview): typos
1 parent 88453a7 commit 211973c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/docs/reference/new-types/intersection-types.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ The type `S & T` represents values that are of the type `S` and `T` at the same
1111

1212
```scala
1313
trait Resettable {
14-
def reset(): this.type
14+
def reset(): Unit
1515
}
1616
trait Growable[T] {
17-
def add(x: T): this.type
17+
def add(t: T): Unit
1818
}
1919
def f(x: Resettable & Growable[String]) = {
2020
x.reset()
2121
x.add("first")
2222
}
2323
```
2424

25-
The value `x` is required to be _both_ a `Resettable` and a
25+
The parameter `x` is required to be _both_ a `Resettable` and a
2626
`Growable[String]`.
2727

2828
The members of an intersection type `A & B` are all the members of `A` and all
@@ -51,8 +51,8 @@ can be further simplified to `List[A & B]` because `List` is
5151
covariant.
5252

5353
One might wonder how the compiler could come up with a definition for
54-
`children` of type `List[A & B]` since all its is given are `children`
55-
definitions of type `List[A]` and `List[B]`. The answer is it does not
54+
`children` of type `List[A & B]` since what is given are `children`
55+
definitions of type `List[A]` and `List[B]`. The answer is the compiler does not
5656
need to. `A & B` is just a type that represents a set of requirements for
5757
values of the type. At the point where a value is _constructed_, one
5858
must make sure that all inherited members are correctly defined.

0 commit comments

Comments
 (0)