Skip to content

Commit 3d7cf5b

Browse files
committed
Merge pull request #377 from lauris/patch-1
Fix code highlighting.
2 parents 0729cef + 7085468 commit 3d7cf5b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tutorials/tour/extractor-objects.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ In Scala, patterns can be defined independently of case classes. To this end, a
1919
val x = Twice(21)
2020
x match { case Twice(n) => Console.println(n) } // prints 21
2121
}
22+
2223
There are two syntactic conventions at work here:
2324

2425
The pattern `case Twice(n)` will cause an invocation of `Twice.unapply`, which is used to match any even number; the return value of the `unapply` signals whether the argument has matched or not, and any sub-values that can be used for further matching. Here, the sub-value is `z/2`

0 commit comments

Comments
 (0)