-
Notifications
You must be signed in to change notification settings - Fork 384
Open
Description
The hasItem matcher has the signature
Matcher<Iterable<? super T>> hasItem(Matcher<? super T> itemMatcher)but it should be
Matcher<Iterable<? extends T>> hasItem(Matcher<? super T> itemMatcher)because the matcher needs to read items from the Iterable and it needs the contract that the sequence contains at least items of type T, so it should be covariant in T
The current implementation states the opposite, it would be applicable it the matcher wanted to write to the iterable, but that is (a) not possible, since there is no write operation on an iterable and (b) not its usecase.
foal
Metadata
Metadata
Assignees
Labels
No labels