Skip to content

Commit f8a1dea

Browse files
authored
Merge pull request #8 from jetbrains-academy/structuring_information_sealed_traits_task_description_fix
Structuring Information - Sealed Traits: task.md fixed formatting
2 parents 071d966 + 75911ca commit f8a1dea

File tree

1 file changed

+3
-4
lines changed
  • Structuring Information/Defining Alternatives With Sealed Traits

1 file changed

+3
-4
lines changed

Structuring Information/Defining Alternatives With Sealed Traits/task.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ Having defined `Symbol` as a sealed trait gives us the guarantee that
7070
the possible case of symbols is fixed. The compiler can leverage this
7171
knowledge to warn us if we write code that does not handle *all*
7272
the cases:
73-
{{{
73+
```scala
7474
def unexhaustive(): Unit = {
75-
sealed trait Symbol
75+
sealed trait Symbol
7676
case class Note(name: String, duration: String, octave: Int) extends Symbol
7777
case class Rest(duration: String) extends Symbol
7878

@@ -81,8 +81,7 @@ def nonExhaustiveDuration(symbol: Symbol): String =
8181
case Rest(duration) => duration
8282
}
8383
}
84-
}}
85-
84+
```
8685
If we try to run the above code to see how the compiler informs us that
8786
we don’t handle all the cases in `nonExhaustiveDuration`.
8887

0 commit comments

Comments
 (0)