liangzai-cool / hamcrest

Automatically exported from code.google.com/p/hamcrest
0 stars 0 forks source link

Is.is(Class) Should be Is.is(Class<?>) #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using the compiler in Eclipse 3.3 RC1, and the latest checkout of hamcrest,
the following method does not compile:

    public void testProvidesConvenientShortcutForIsInstanceOf() {
        assertMatches("should match", is(String.class), "A");
        assertDoesNotMatch("should not match", is(Integer.class), "A");
        assertDoesNotMatch("should not match", is(Integer.class), null);
    }

On each line, the error message is (for example) "The method
is(Class<Integer>) is ambiguous for the type IsTest"

If the signature of Is.is(Class) is changed to Is.is(Class<?>), this goes away.

Original issue reported on code.google.com by david.s...@gmail.com on 25 May 2007 at 2:15

GoogleCodeExporter commented 9 years ago
On second attempt, it looks like I simply had a stale check-out.  Sorry.

Original comment by david.s...@gmail.com on 25 May 2007 at 7:47

GoogleCodeExporter commented 9 years ago

Original comment by joe.wal...@gmail.com on 26 May 2007 at 10:29