From 1ed6277fc5e939c915f7cb005010d8ac2affb216 Mon Sep 17 00:00:00 2001 From: Qiuyang Nie Date: Wed, 20 Nov 2019 13:55:48 +0000 Subject: [PATCH] Fix a little bug in the example code The variable (a, b, c) in each case should be matched the variable printed out. --- _overviews/scala-book/match-expressions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_overviews/scala-book/match-expressions.md b/_overviews/scala-book/match-expressions.md index e06a178a11..4edf0d1cac 100644 --- a/_overviews/scala-book/match-expressions.md +++ b/_overviews/scala-book/match-expressions.md @@ -226,8 +226,8 @@ Here are a few other examples of how you can use `if` expressions in `case` stat ```scala i match { case a if 0 to 9 contains a => println("0-9 range: " + a) - case b if 10 to 19 contains b => println("10-19 range: " + a) - case c if 20 to 29 contains c => println("20-29 range: " + a) + case b if 10 to 19 contains b => println("10-19 range: " + b) + case c if 20 to 29 contains c => println("20-29 range: " + c) case _ => println("Hmmm...") } ```