Page 393 (PDF page 430):
In the second paragraph, right after the code example, it says "then if T
is a subtype of type S, this would imply that Queue[S] is a subtype of
Queue[T]" I guess it should be "then if S is a subtype of type T..."
|
Page 393 (PDF page 430):
I read the errate corrige relate this Page :
"
Page 393 (PDF page 430):
In the second paragraph, right after the code example, it says
"then if T is a subtype of type S, this would imply that Queue[S]
is a subtype of Queue[T]" I guess it should be "then if S is a
subtype of type T..."
"
This correction is WRONG :
the text in book is correct because with controvariance
is T is a subtype of S thus ==> Queue(S) is subtype Queue(T)
|
Page 399 (PDF page 436):
I'm not sure but this page does not seem correct:
this is text of book: (the sign after T,W,U are intended as superscript)
abstract class Cat[-T,+U] {
def meow[W-]( volume: T-,listener: Cat[U+, T-]-)
: Cat[Cat[U+, T-]- , U+]+
}
This definition seems to contradict what is said later:
" .... In this case T is only used in negative positions and U is only
used in positive positions... "
the correct form should be:
abstract class Cat[-T,+U] {
def meow[W-]( volume: T- ,listener: Cat[T-,U+]-)
: Cat[Cat[T-, U+]- , U+]+
}
it would not hurt if the example was explained in a little more detail
|