Skip to content

Commit 883198c

Browse files
Merge pull request #9389 from ShapelessCat/fix-docs_code-examples-for-collective-extensions
Fix docs code examples for collective extensions
2 parents 76d9eb7 + c118489 commit 883198c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ a single extension and enclose all methods in braces or an indented region follo
102102
Example:
103103

104104
```scala
105-
extension (ss: Seq[String])
105+
extension (ss: Seq[String]):
106106

107107
def longestStrings: Seq[String] =
108108
val maxLength = ss.map(_.length).max
@@ -130,7 +130,7 @@ extension (ss: Seq[String])
130130
Collective extensions also can take type parameters and have using clauses. Example
131131

132132
```scala
133-
extension [T](xs: List[T])(using Ordering[T])
133+
extension [T](xs: List[T])(using Ordering[T]):
134134
def smallest(n: Int): List[T] = xs.sorted.take(n)
135135
def smallestIndices(n: Int): List[Int] =
136136
val limit = smallest(n).max

0 commit comments

Comments
 (0)