Open GoogleCodeExporter opened 9 years ago
Original comment by t.denley
on 16 Aug 2012 at 7:59
+1
Same issue occurs on contains(). Trivial example:
List<Matcher<Integer>> matchers = ImmutableList.of(
equalTo(1)
);
assertThat(ImmutableList.of(1), contains(matchers));
Fails because it is calling the contains(Object...) method instead.
It is possible to work around it though:
List<Matcher<? super Object>> matchers = ImmutableList.of(
equalTo(1)
);
assertThat(ImmutableList.of(1), contains(matchers));
This works, but because I'm matching a List<Integer>, I don't get why I can't
provide a List<Matcher<Integer>>.
Original comment by trejkaz
on 4 Mar 2015 at 4:26
Original issue reported on code.google.com by
wshie...@google.com
on 10 Aug 2012 at 2:06