Reputation: 12220
Why does the method
def collect[B](pf: PartialFunction[A, B]): List[B]
declared with the method only being dependent on the type B
(collect[B]
)?
The signature shows this method depends on both A
and B
.
Upvotes: 0
Views: 41
Reputation: 1481
It depends on A
but A
is already determined by the Type you created the list of, because collect
is a function of the class List[A]
.
Upvotes: 3