Skip to content

Commit

Permalink
fix: removed override modifer from exercise in W10
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesnydahl committed Nov 16, 2023
1 parent fed7485 commit bb3df16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compendium/modules/w10-inheritance-exercise.tex
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@

\Subtask Öppna en editor och koda \code{trait Pair[T]} i en fil \code{pairs.scala}. Lägg dessutom till en konkret metod \code{tuple} i \code{Pair[T]} som returnerar en 2-tupel med de båda elementen i paret, så att det vid behov går att omvandla \code{Pair}-instanser till 2-tupler. Använd REPL via \code{sbt console} för att testa att detta fungerar:
\begin{REPLnonum}
scala> val p = new Pair[Int] { override val x = 10; override val y = 20 }
scala> val p = new Pair[Int] { val x = 10; val y = 20 }
p: Pair[Int]{val x: Int; val y: Int} = $anon$1@784223e9

scala> p.tuple
Expand Down

0 comments on commit bb3df16

Please sign in to comment.