From 0ed0073db25e86baec4d31b3929731480d48baad Mon Sep 17 00:00:00 2001 From: Erik Pohl <89852209+ErikPohl444@users.noreply.github.com> Date: Fri, 13 Dec 2024 09:52:43 -0500 Subject: [PATCH 1/3] Update pattern-matching.md Added a note about sealed traits because it is the first usage of them in the guide. --- _tour/pattern-matching.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_tour/pattern-matching.md b/_tour/pattern-matching.md index a89c16775f..340742d1c9 100644 --- a/_tour/pattern-matching.md +++ b/_tour/pattern-matching.md @@ -92,7 +92,7 @@ case class VoiceRecording(contactName: String, link: String) extends Notificatio {% endtab %} {% endtabs %} -`Notification` is a sealed trait which has three concrete Notification types implemented with case classes `Email`, `SMS`, and `VoiceRecording`. Now we can do pattern matching on these case classes: +`Notification` is a sealed trait which has three concrete Notification types implemented with case classes `Email`, `SMS`, and `VoiceRecording`. (A sealed trait can be extended only in the same file as its declaration.) Now we can do pattern matching on these case classes: {% tabs pattern-matching-4 class=tabs-scala-version %} {% tab 'Scala 2' for=pattern-matching-4 %} From 6222097a13a25491428e6584c4e7604552f2e5be Mon Sep 17 00:00:00 2001 From: Erik Pohl <89852209+ErikPohl444@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:13:59 -0500 Subject: [PATCH 2/3] Update pattern-matching.md Added a link to sealed types below --- _tour/pattern-matching.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_tour/pattern-matching.md b/_tour/pattern-matching.md index 340742d1c9..d49f4492c4 100644 --- a/_tour/pattern-matching.md +++ b/_tour/pattern-matching.md @@ -92,7 +92,7 @@ case class VoiceRecording(contactName: String, link: String) extends Notificatio {% endtab %} {% endtabs %} -`Notification` is a sealed trait which has three concrete Notification types implemented with case classes `Email`, `SMS`, and `VoiceRecording`. (A sealed trait can be extended only in the same file as its declaration.) Now we can do pattern matching on these case classes: +`Notification` is a sealed trait which has three concrete Notification types implemented with case classes `Email`, `SMS`, and `VoiceRecording`. (A [sealed trait](#Sealed-types) can be extended only in the same file as its declaration.) Now we can do pattern matching on these case classes: {% tabs pattern-matching-4 class=tabs-scala-version %} {% tab 'Scala 2' for=pattern-matching-4 %} From 66a998f4832d967d5b15c1078110596f038c35b5 Mon Sep 17 00:00:00 2001 From: Erik Pohl <89852209+ErikPohl444@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:44:07 -0500 Subject: [PATCH 3/3] Update _tour/pattern-matching.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks for catching this. I learned a bit more about successful markdown links. I accept the edit. Co-authored-by: Gabriel Kępka <44374670+gkepka@users.noreply.github.com> --- _tour/pattern-matching.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_tour/pattern-matching.md b/_tour/pattern-matching.md index d49f4492c4..96426e0b06 100644 --- a/_tour/pattern-matching.md +++ b/_tour/pattern-matching.md @@ -92,7 +92,7 @@ case class VoiceRecording(contactName: String, link: String) extends Notificatio {% endtab %} {% endtabs %} -`Notification` is a sealed trait which has three concrete Notification types implemented with case classes `Email`, `SMS`, and `VoiceRecording`. (A [sealed trait](#Sealed-types) can be extended only in the same file as its declaration.) Now we can do pattern matching on these case classes: +`Notification` is a sealed trait which has three concrete Notification types implemented with case classes `Email`, `SMS`, and `VoiceRecording`. (A [sealed trait](/tour/pattern-matching.html#sealed-types) can be extended only in the same file as its declaration.) Now we can do pattern matching on these case classes: {% tabs pattern-matching-4 class=tabs-scala-version %} {% tab 'Scala 2' for=pattern-matching-4 %}