Skip to content

Commit

Permalink
Fix typo in variances.md
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 362a66b
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 362a66b

Please sign in to comment.