docs.scala-lang icon indicating copy to clipboard operation
docs.scala-lang copied to clipboard

Fixed types-variance.md contravariant example code comment

Open still-dreaming-1 opened this issue 1 year ago • 7 comments

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.

still-dreaming-1 avatar Dec 20 '23 19:12 still-dreaming-1