Skip to content

Commit d79d658

Browse files
committed
Fix wording of translation rule
1 parent e95bb6f commit d79d658

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/docs/reference/extend/extension-methods.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ assert(circle.circumference == CircleOps.circumference(circle))
3535
### Translation of Calls to Extension Methods
3636

3737
The rules for resolving a selection `e.m` are augmented as follows: If `m` is not a
38-
member of the type `T` of `e`, and there is an implicit value `i` that defines `m`
39-
in either the current scope or in the implicit scope of `T`, then `e.m` is expanded
40-
to `i.m(e)`. This expansion is attempted at the time where the compiler also tries an implicit conversion from `T` to a type containing `m`. If there is more than one way
38+
member of the type `T` of `e`, and there is an implicit value `i`
39+
in either the current scope or in the implicit scope of `T`, and `i` defines an extension
40+
method named `m`, then `e.m` is expanded to `i.m(e)`. This expansion is attempted at the time where the compiler also tries an implicit conversion from `T` to a type containing `m`. If there is more than one way
4141
of expanding, an ambiguity error results.
4242

4343
So `circle.circumference` translates to `CircleOps.circumference(circle)`, provided
@@ -236,8 +236,8 @@ Extension methods generalize to higher-kinded types without requiring special pr
236236
implicit class ReaderMonad[Ctx] extends Monad[[X] => Ctx => X] {
237237
def (r: Ctx => A).flatMap[A, B](f: A => Ctx => B): Ctx => B =
238238
ctx => f(r(ctx))(ctx)
239-
def pure[A](x: A): Ctx =>
240-
A = ctx => x
239+
def pure[A](x: A): Ctx => A =
240+
ctx => x
241241
}
242242
```
243243
### Syntax

0 commit comments

Comments
 (0)