We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c753ca3 commit c118489Copy full SHA for c118489
docs/docs/reference/contextual/extension-methods.md
@@ -102,7 +102,7 @@ a single extension and enclose all methods in braces or an indented region follo
102
Example:
103
104
```scala
105
-extension (ss: Seq[String])
+extension (ss: Seq[String]):
106
107
def longestStrings: Seq[String] =
108
val maxLength = ss.map(_.length).max
@@ -130,7 +130,7 @@ extension (ss: Seq[String])
130
Collective extensions also can take type parameters and have using clauses. Example
131
132
133
-extension [T](xs: List[T])(using Ordering[T])
+extension [T](xs: List[T])(using Ordering[T]):
134
def smallest(n: Int): List[T] = xs.sorted.take(n)
135
def smallestIndices(n: Int): List[Int] =
136
val limit = smallest(n).max
0 commit comments