Skip to content

Commit

Permalink
Merge pull request #778 from johannesnydahl/master
Browse files Browse the repository at this point in the history
Removed override modifer from exercise in W10
  • Loading branch information
bjornregnell authored Jun 25, 2024
2 parents 1511e72 + bb3df16 commit c2ea3b4
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 @@ -292,7 +292,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

1 comment on commit c2ea3b4

@bjornregnell
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverting this here 73c4496

Please sign in to comment.