transitive overriding methods check: applied for interfaces (IDEA-174806)

This commit is contained in:
Anna Kozlova
2017-06-23 18:19:42 +03:00
parent 0e5a7bca67
commit fdf412aca7
3 changed files with 24 additions and 2 deletions
@@ -0,0 +1,16 @@
interface Car {}
interface Ferrari extends Car {}
interface ICarRepairShop<C extends Car> {
void repair(C car);
}
class AbstractCarRepairShop<C extends Car> implements ICarRepairShop<C> {
@Override
public void repair(Car car) { }
}
<error descr="'repair(C)' in 'ICarRepairShop' clashes with 'repair(Car)' in 'AbstractCarRepairShop'; both methods have same erasure, yet neither overrides the other">class FerrariRepairShop extends AbstractCarRepairShop<Ferrari></error> {
@Override
public void repair(Ferrari car) {
}
}