mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Better wording about breaks in cases
This commit is contained in:
parent
8f29b15cda
commit
c053f1559b
@ -409,7 +409,7 @@ val otherGeorge = george.copy(phoneNumber = "9876")
|
|||||||
|
|
||||||
// Pattern matching is a powerful and commonly used feature in Scala. Here's how
|
// Pattern matching is a powerful and commonly used feature in Scala. Here's how
|
||||||
// you pattern match a case class. NB: Unlike other languages, Scala cases do
|
// you pattern match a case class. NB: Unlike other languages, Scala cases do
|
||||||
// not have breaks.
|
// not need breaks, fall-through does not happen.
|
||||||
|
|
||||||
def matchPerson(person: Person): String = person match {
|
def matchPerson(person: Person): String = person match {
|
||||||
// Then you specify the patterns:
|
// Then you specify the patterns:
|
||||||
|
Loading…
Reference in New Issue
Block a user