Cascading: ClassCastException from generic method whose return type uses two type parameters #158

Closed
rliesenfeld opened this Issue Mar 20, 2015 · 0 comments

Comments

1 participant
@rliesenfeld
Member

rliesenfeld commented Mar 20, 2015

The following example test fails with a CCE:

    public interface GenericInterface<T> { <S extends T> S save(S entity); }
    public interface ConcreteInterface extends GenericInterface<String> {}

    @Test
    public void cascadingFromGenericMethodWhoseTypeParameterExtendsAnother(@Mocked ConcreteInterface mock)
    {
        String value = "test";

        String saved = mock.save(value);

        assertNull(saved);
    }    

@rliesenfeld rliesenfeld added the bug label Mar 20, 2015

@rliesenfeld rliesenfeld self-assigned this Mar 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment