From dd00a513dcdc8dace4baa4ef670699ecaa7c209d Mon Sep 17 00:00:00 2001 From: Erik Wright Date: Thu, 2 May 2019 16:30:31 -0400 Subject: [PATCH] Remove misleading example While the example is interesting in that it shows an example of advanced pattern matching, it is problematic in that the pattern used is not of a valid type for the rest of the code. As it is not really relevant to the issue at hand, and given that it's a relatively advanced example not likely to be relevant to someone first learning the language, I suggest simply removing it. A separate section on advanced pattern matching could potentially cover it. Fixes #34 --- src/main/scala/scalatutorial/sections/StandardLibrary.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/scala/scalatutorial/sections/StandardLibrary.scala b/src/main/scala/scalatutorial/sections/StandardLibrary.scala index 101821ad..09e59716 100644 --- a/src/main/scala/scalatutorial/sections/StandardLibrary.scala +++ b/src/main/scala/scalatutorial/sections/StandardLibrary.scala @@ -96,9 +96,7 @@ object StandardLibrary extends ScalaTutorialSection { * // Same as `x :: Nil` * case List(x) => … * // The empty list, same as `Nil` - * case List() => - * // A list that contains as only element another list that starts with `2` - * case List(2 :: xs) => … + * case List() => … * } * }}} *