Skip to content

Commit a1fdf1e

Browse files
committed
Change the way of writing a extension method header
- This subsection explains generic extensions WITHOUT using clause(s) first, and then explains generic extensions WITH using clause(s). The changed code is for the first part, and don't introduce using clause(s) in it is more suitable in this context.
1 parent 2f48b6e commit a1fdf1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ themselves:
7979

8080
```scala
8181
extension [T](xs: List[T])
82-
def sumBy[U](f: T => U)(using Numeric[U]): U = ...
82+
def sumBy[U: Numeric](f: T => U): U = ...
8383
```
8484

8585
Type arguments matching method type parameters are passed as usual:

0 commit comments

Comments
 (0)