Skip to content

Commit

Permalink
Fix typo in variances.md (#2922)
Browse files Browse the repository at this point in the history
We need the `new` keyword to create an anonymous class
  • Loading branch information
adpi2 authored Oct 31, 2023
1 parent 259fbb1 commit 009da6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _tour/variances.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ catSerializer.serialize(Cat("Felix"))
abstract class Serializer[-A]:
def serialize(a: A): String

val animalSerializer: Serializer[Animal] = Serializer[Animal]():
val animalSerializer: Serializer[Animal] = new Serializer[Animal]():
def serialize(animal: Animal): String = s"""{ "name": "${animal.name}" }"""

val catSerializer: Serializer[Cat] = animalSerializer
Expand Down

0 comments on commit 009da6a

Please sign in to comment.