From 47fabb06a1aa804afb79fa7b1a8054f478940ab6 Mon Sep 17 00:00:00 2001 From: still-dreaming-1 Date: Wed, 20 Dec 2023 12:07:07 -0700 Subject: [PATCH] Fixed types-variance.md contravariant example code comment Fixed the second code comment for the last example just before the summary. The words "Book" and "Buyable" needed to be swapped. This makes it consistent with how the first comment uses the term "expected", where "expected" refers to the type you see in the following line of code. The first code comment is referring to the return type in the next line of code. The second comment is referring to the parameter type in the following line of code. Therefore, in the second code comment, "Book" is what is "expected" (by the h type), and "Buyable" is what is "provided" by the f parameter type. --- _overviews/scala3-book/types-variance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_overviews/scala3-book/types-variance.md b/_overviews/scala3-book/types-variance.md index deb2492e8..f3221a035 100644 --- a/_overviews/scala3-book/types-variance.md +++ b/_overviews/scala3-book/types-variance.md @@ -219,7 +219,7 @@ val f: Function[Buyable, Buyable] = b => b // OK to return a Buyable where a Item is expected val g: Function[Buyable, Item] = f -// OK to provide a Book where a Buyable is expected +// OK to provide a Buyable where a Book is expected val h: Function[Book, Buyable] = f ``` {% endtab %}