From 362a66bd59a94f2fe714a41d1dd25bd552dc75d0 Mon Sep 17 00:00:00 2001 From: adpi2 Date: Tue, 31 Oct 2023 12:14:16 +0100 Subject: [PATCH] Fix typo in variances.md We need the `new` keyword to create an anonymous class --- _tour/variances.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_tour/variances.md b/_tour/variances.md index 7040a9cae..87fc6029a 100644 --- a/_tour/variances.md +++ b/_tour/variances.md @@ -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