Here is a simplified version of what is being done in one of my projects:
List<String> names = ...
assertThat(names, is(empty()));
This works fine on my Eclipse running in Java 1.7.0.79(and on 1.6.0.31).
However, the compilation failed on a remote system that uses Java 1.7.0.55(and 1.6.0.29), and an error message appears here:
no suitable method found for assertThat(java.util.List<String>,org.hamcrest.Matcher<java.util.Collection<java.lang.Object>>)
method org.hamcrest.MatcherAssert.<T>assertThat(T,org.hamcrest.Matcher<? super T>) is not applicable
(actual argument org.hamcrest.Matcher<java.util.Collection<java.lang.Object>> cannot be converted to org.hamcrest.Matcher<? super java.util.List<String>> by method invocation conversion)
method org.hamcrest.MatcherAssert.<T>assertThat(java.lang.String,T,org.hamcrest.Matcher<? super T>) is not applicable
(cannot instantiate from arguments because actual and formal argument lists differ in length)
method org.hamcrest.MatcherAssert.assertThat(java.lang.String,boolean) is not applicable
(actual argument java.util.List<String> cannot be converted to java.lang.String by method invocation conversion)
I expect the first overloaded option to fit my case, but that is not related to any inference like iffy. Why does the compiler seem that the actual argument is of type org.hamcrest.Matcher<java.util.Collection<java.lang.Object>>when it should obviously be org.hamcrest.Matcher<java.util.Collection<? extends java.lang.Object>>, knowing the signatures is and empty.
, , JDK , prod. , . , , JDK.. , JDK .
hamcrest 1.3 BTW.