Skip to content

Commit c76dc80

Browse files
committed
Address some points in code review.
1 parent 907d73a commit c76dc80

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

docs/_docs/internals/syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ GivenConditional ::= DefTypeParamClause
486486
GivenType ::= AnnotType1 {id [nl] AnnotType1}
487487
488488
OldGivenDef ::= [OldGivenSig] (AnnotType [‘=’ Expr] | StructuralInstance) -- syntax up to Scala 3.5, to be deprecated in the future
489-
OldGivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ -- one of `id`, `DefTypeParamClause`, `UsingParamClause` must be present
489+
OldGivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ -- one of `id`, `DefTypeParamClause`, `UsingParamClause` must be present
490490
StructuralInstance ::= ConstrApp {‘with’ ConstrApp} [‘with’ WithTemplateBody]
491491
492492
Extension ::= ‘extension’ [DefTypeParamClause] {UsingParamClause}

docs/_docs/reference/contextual/context-bounds.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The witness context parameter(s) generated from context bounds are added as foll
7171

7272
1. If one of the bounds is referred to by its name in a subsequent parameter clause, the context bounds are mapped to a using clause immediately preceding the first such parameter clause.
7373
2. Otherwise, if the last parameter clause is a using (or implicit) clause, merge all parameters arising from context bounds in front of that clause, creating a single using clause.
74-
3. Otherwise, let the parameters arising from context bounds form a new using clause at the end.
74+
3. Otherwise, the parameters arising from context bounds form a new using clause at the end.
7575

7676
Rules (2) and (3) match Scala 2's rules. Rule (1) is new but since context bounds so far could not be referred to, it does not apply to legacy code. Therefore, binary compatibility with Scala 2 and earlier Scala 3 versions is maintained.
7777

@@ -151,11 +151,14 @@ val less: Comparer = [X] => (x: X, y: X) => (ord: Ord[X]) ?=>
151151
The expansion of using clauses does look inside alias types. For instance,
152152
here is a variation of the previous example that uses a parameterized type alias:
153153
```scala
154-
type Cmp[X] = (x: X, y: X) => Ord[X] ?=> Boolean
154+
type Cmp[X] = (x: X, y: X) => Boolean
155155
type Comparer2 = [X: Ord] => Cmp[X]
156156
```
157157
The expansion of the right hand side of `Comparer2` expands the `Cmp[X]` alias
158-
and then inserts the context function at the same place as what's done for `Comparer`.
158+
and then inserts the context function at the same place as what's done for `Comparer`:
159+
```scala
160+
[X] => (x: X, y: X) => Ord[X] ?=> Boolean
161+
```
159162

160163
### Context Bounds for Type Members
161164

docs/_docs/reference/syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ GivenConditional ::= DefTypeParamClause
461461
GivenType ::= AnnotType1 {id [nl] AnnotType1}
462462
463463
OldGivenDef ::= [OldGivenSig] (AnnotType [‘=’ Expr] | StructuralInstance) -- syntax up to Scala 3.5, to be deprecated in the future
464-
OldGivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ -- one of `id`, `DefTypeParamClause`, `UsingParamClause` must be present
464+
OldGivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ -- one of `id`, `DefTypeParamClause`, `UsingParamClause` must be present
465465
StructuralInstance ::= ConstrApp {‘with’ ConstrApp} [‘with’ WithTemplateBody]
466466
467467
Extension ::= ‘extension’ [DefTypeParamClause] {UsingParamClause}

0 commit comments

Comments
 (0)