Skip to content

Commit aeb24d4

Browse files
committed
Fix typos
1 parent 153600f commit aeb24d4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/docs/reference/common-declarations.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class FlatText(str: String) extends Text {
2929
}
3030
```
3131

32-
The `common` definition of `fromString` is abstract in trait `Text`. It is defined in the implementing companion object of `FlatText`. By contrast, the `fromStrings` method in trait Text is concrete, with an implementation referring to the abstract `fromString`. It is inherited by the companion object `FlatText`. So the following are legal:
32+
The `common` method `fromString` is abstract in trait `Text`. It is defined in the implementing companion object of `FlatText`. By contrast, the `fromStrings` method in trait Text is concrete, with an implementation referring to the abstract `fromString`. It is inherited by the companion object `FlatText`. So the following are legal:
3333

3434
```scala
3535
val txt1 = FlatText.fromString("hello")
@@ -44,7 +44,7 @@ val erroneous = Text.fromStrings("hello", ", world") // error: not found
4444

4545
## The `Instance` type
4646

47-
In the previous example, the argument and result type of `concat` is just `Text`. So every implementation of `Text` has to be prepared to concatenate all possible implementatons of `Text`. Furthermore, we hide the concrete implementation type in the result type of `concat` and of the construction methods `fromString` and `fromStrings`. Sometimes we want a different design that specifyfies the actual implementation type instead of the base trait `Text`. We can refer to this type using the predefined type `Instance`:
47+
In the previous example, the argument and result type of `concat` is just `Text`. So every implementation of `Text` has to be prepared to concatenate all possible implementatons of `Text`. Furthermore, we hide the concrete implementation type in the result type of `concat` and of the construction methods `fromString` and `fromStrings`. Sometimes we want a different design that specifies the actual implementation type instead of the base trait `Text`. We can refer to this type using the predefined type `Instance`:
4848

4949
```scala
5050
trait Text {
@@ -114,8 +114,8 @@ the object that implements the `common` definitions.
114114
## Translation
115115

116116
The translation of a trait `T` that defines `common` declarations `common D1, ..., common Dn`
117-
and extends traits with common declarations `P1`, ..., Pn` is as follows:
118-
All `common` definitions are put in a trait `T.Common` which is defined in `T`'s companion object:
117+
and extends traits with common declarations `P1, ..., Pn` is as follows:
118+
All `common` declarations are put in a trait `T.Common` which is defined in `T`'s companion object:
119119

120120
object T {
121121
trait Common extends P1.Common with ... with Pn.Common { self =>
@@ -130,7 +130,7 @@ The trait inherits all `Common` traits associated with `T`'s parent traits. If n
130130
given, it declares the `Instance` type as shown above. The trait `T` itself is expanded as follows:
131131

132132
trait T extends ... {
133-
val `common`: `T.Common`
133+
val `common`: T.Common
134134
import `common`._
135135

136136
...
@@ -141,7 +141,7 @@ Any direct reference to `x.common` in the body of `T` is simply translated to
141141
x.`common`
142142

143143
The translation of a class `C` that defines `common` declarations `common D1, ..., common Dn`
144-
and extends traits with common declarations `P1`, ..., Pn` is as follows:
144+
and extends traits with common declarations `P1, ..., Pn` is as follows:
145145
All `common` definitions of the class itself are placed in `C`'s companion object, which also inherits all
146146
`Common` traits of `C`'s parents. If `C` already defines a companion object, the synthesized parents
147147
come after the explicitly declared ones, whereas the common definitions precede all explicitly given statements of the

0 commit comments

Comments
 (0)