Skip to content

Commit 6ad8502

Browse files
committed
Adress review comments
1 parent be710fa commit 6ad8502

File tree

9 files changed

+31
-32
lines changed

9 files changed

+31
-32
lines changed

docs/docs/internals/syntax.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ yield
104104
### Soft keywords
105105

106106
```
107-
derives end extension inline infix opaque oapque open
108-
transparent using | * + -
107+
derives end extension inline infix opaque open transparent using | * + -
109108
```
110109
## Context-free Syntax
111110

docs/docs/reference/changed-features/compiler-plugins.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ class DivideZeroPhase extends PluginPhase:
7979

8080
override def transformApply(tree: Apply)(implicit ctx: Context): Tree =
8181
tree match
82-
case Apply(Select(rcvr, nme.DIV), List(Literal(Constant(0))))
83-
if rcvr.tpe <:< defn.IntType =>
84-
report.error("dividing by zero", tree.pos)
85-
case _ =>
86-
()
82+
case Apply(Select(rcvr, nme.DIV), List(Literal(Constant(0))))
83+
if rcvr.tpe <:< defn.IntType =>
84+
report.error("dividing by zero", tree.pos)
85+
case _ =>
86+
()
8787
tree
8888
end DivideZeroPhase
8989
```

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ types:
4444
```scala
4545
import scala.language.implicitConversions
4646
implicit def ordT[T, S](
47-
implicit conv: Conversion[T, S],
48-
ordS: Ordering[S]
49-
): Ordering[T] =
50-
// `ordS` compares values of type `S`, but we can convert from `T` to `S`
47+
implicit conv: Conversion[T, S],
48+
ordS: Ordering[S]
49+
): Ordering[T] =
50+
// `ordS` compares values of type `S`, but we can convert from `T` to `S`
5151
(x: T, y: T) => ordS.compare(x, y)
5252

5353
class A(val x: Int) // The type for which we want an `Ordering`

docs/docs/reference/changed-features/implicit-resolution.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ where the type may still be inferred:
1313
```scala
1414
class C {
1515

16-
val ctx: Context = ... // ok
16+
val ctx: Context = ... // ok
1717

18-
/*!*/ implicit val x = ... // error: type must be given explicitly
18+
/*!*/ implicit val x = ... // error: type must be given explicitly
1919

20-
/*!*/ implicit def y = ... // error: type must be given explicitly
20+
/*!*/ implicit def y = ... // error: type must be given explicitly
2121
}
2222
val y = {
23-
implicit val ctx = this.ctx // ok
24-
...
23+
implicit val ctx = this.ctx // ok
24+
...
2525
}
2626
```
2727
**2.** Nesting is now taken into account for selecting an implicit. Consider for instance the following scenario:
2828
```scala
2929
def f(implicit i: C) = {
30-
def g(implicit j: C) = {
31-
implicitly[C]
32-
}
30+
def g(implicit j: C) = {
31+
implicitly[C]
32+
}
3333
}
3434
```
3535
This will now resolve the `implicitly` call to `j`, because `j` is nested
@@ -43,10 +43,10 @@ no longer applies.
4343
package p
4444

4545
given a: A = A()
46-
46+
4747
object o:
48-
given b: B = B()
49-
type C
48+
given b: B = B()
49+
type C
5050
```
5151
Both `a` and `b` are visible as implicits at the point of the definition
5252
of `type C`. However, a reference to `p.o.C` outside of package `p` will

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ than other classes. Here is an example:
126126
trait Vehicle extends reflect.Selectable:
127127
val wheels: Int
128128

129-
val i3 = new Vehicle with // i3: Vehicle { val range: Int }
129+
val i3 = new Vehicle: // i3: Vehicle { val range: Int }
130130
val wheels = 4
131131
val range = 240
132132

@@ -139,10 +139,10 @@ defines the necessary `selectDynamic` member.
139139

140140
`Vehicle` could also extend some other subclass of `scala.Selectable` that implements `selectDynamic` and `applyDynamic` differently. But if it does not extend a `Selectable` at all, the code would no longer typecheck:
141141
```scala
142-
class Vehicle:
142+
trait Vehicle:
143143
val wheels: Int
144144

145-
val i3 = new Vehicle with // i3: Vehicle
145+
val i3 = new Vehicle: // i3: Vehicle
146146
val wheels = 4
147147
val range = 240
148148

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ does not need boxing either. Hence, the implementation of `ensuring` is as about
141141
as the best possible code one could write by hand:
142142

143143
```scala
144-
val result = List(1, 2, 3).sum
145-
assert(result == 6)
146-
result
144+
val s =
145+
val result = List(1, 2, 3).sum
146+
assert(result == 6)
147+
result
147148
```
148149
### Reference
149150

docs/docs/reference/other-new-features/control-syntax.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The rules in detail are:
3838
- The enumerators of a `for`-expression can be written without enclosing parentheses or braces if they are followed by a `yield` or `do`.
3939
- A `do` in a `for`-expression expresses a `for`-loop.
4040
- A `catch` can be followed by a single case on the same line.
41-
If there are multiple cases, thesÍe have to be appear within braces (just like in Scala 2)
41+
If there are multiple cases, these have to be appear within braces (just like in Scala 2)
4242
or an indented block.
4343
### Rewrites
4444

docs/docs/reference/other-new-features/type-test.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ trait Peano:
121121
val Zero: Zero
122122

123123
val Succ: SuccExtractor
124-
trait SuccExtractor
124+
trait SuccExtractor:
125125
def apply(nat: Nat): Succ
126126
def unapply(nat: Succ): Option[Nat]
127127

docs/docs/reference/syntax.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ type val var while with yield
103103
### Soft keywords
104104

105105
```
106-
derives end extension inline infix opaque oapque open
107-
transparent using | * + -
106+
derives end extension inline infix opaque open transparent using | * + -
108107
```
109108
See the [separate section on soft keywords](./soft-modifier.md) for additional
110109
details on where a soft keyword is recognized.

0 commit comments

Comments
 (0)