generics: do not prefer interface over super class even if return type is more specific (IDEA-110568)

This commit is contained in:
anna
2013-07-16 12:30:04 +02:00
parent 968a43f445
commit 8a15ea45ab
3 changed files with 22 additions and 0 deletions
@@ -0,0 +1,20 @@
import java.util.Collection;
public class IncorrectError extends NarrowClass {
public Collection<String> bar() {
return super.doStuff();
}
}
interface Interface {
Collection<String> doStuff();
}
class NarrowClass extends BaseClass implements Interface {
}
class BaseClass {
public Collection doStuff() {
return null;
}
}