mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
transitive overriding methods check: applied for interfaces (IDEA-174806)
This commit is contained in:
+16
@@ -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) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user