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 b123dcb commit dacc9beCopy full SHA for dacc9be
_tour/pattern-matching.md
@@ -36,8 +36,8 @@ def matchTest(x: Int): String = x match {
36
case 2 => "two"
37
case _ => "other"
38
}
39
-matchTest(3) // prints other
40
-matchTest(1) // prints one
+matchTest(3) // returns other
+matchTest(1) // returns one
41
```
42
This match expression has a type String because all of the cases return String. Therefore, the function `matchTest` returns a String.
43
0 commit comments