with the given 2 classes:
public class A{
public <T> Cell<T> f(Cell<T> l){
return null;
}
}
public class B extends A{
public <T> Cell<T> f(Cell<Cell<T>> l){ // trying to override
return null;
}
}
(when Cell is some generic class).
i understand that after type erasure, the classes looks like:
public class A{
public Cell f(Cell l){
return null;
}
}
public class B extends A{
public Cell f(Cell l){ // trying to override
return null;
}
}
before i knew the type erasure thing, i think that i did understand why the compiler sees it as an overloading.
but now that i (think that) i know about the type erasure, the two method signatures are the same, and i really think that it makes much more sense that the compiler will see this as an OVERRIDING.
after compiling it, got that java's compiler saw this as a trying to OVERLOAD and not override, and yields an error for overloading to identical-signatured methods.
my question: why the compiler still sees this as a trying of OVERLOADING and not OVERRIDING, although after type erasure the signatures are just the same?
thanks!