We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7c8920 commit 2b1c5deCopy full SHA for 2b1c5de
docs/docs/reference/contextual/extension-methods.md
@@ -11,7 +11,7 @@ Extension methods allow one to add methods to a type after the type is defined.
11
```scala
12
case class Circle(x: Double, y: Double, radius: Double)
13
14
-def (c: Circle).circumference: Double = c.radius * math.Pi * 2
+def (c: Circle) circumference: Double = c.radius * math.Pi * 2
15
```
16
17
Like regular methods, extension methods can be invoked with infix `.`:
@@ -143,7 +143,7 @@ extension listOps on [T](xs: List[T]) {
143
def third: T = xs.tail.tail.head
144
}
145
146
-extension on [T](xs: List[T]) with Ordering[T]) {
+extension on [T](xs: List[T]) with Ordering[T] {
147
def largest(n: Int) = xs.sorted.takeRight(n)
148
149
0 commit comments